asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

Cannot install Python 3.10.0 on Ubuntu 20.04 #115

Closed SuperSonicHub1 closed 2 years ago

SuperSonicHub1 commented 2 years ago
kwilliams@grahamdell:~$ asdf install python 3.10.0 
python-build 3.10.0 /home/kwilliams/.asdf/installs/python/3.10.0
Downloading Python-3.10.0.tar.xz...
-> https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
Installing Python-3.10.0...

BUILD FAILED (Ubuntu 20.04 using python-build 2.1.0-7-g88c34049)

Inspect or clean up the working tree at /tmp/python-build.20211010150121.89266
Results logged to /tmp/python-build.20211010150121.89266.log

Last 10 log lines:
  File "/tmp/python-build.20211010150121.89266/Python-3.10.0/Lib/ensurepip/__init__.py", line 277, in _main
    return _bootstrap(
  File "/tmp/python-build.20211010150121.89266/Python-3.10.0/Lib/ensurepip/__init__.py", line 193, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "/tmp/python-build.20211010150121.89266/Python-3.10.0/Lib/ensurepip/__init__.py", line 93, in _run_pip
    return subprocess.run([sys.executable, '-W', 'ignore::DeprecationWarning',
  File "/tmp/python-build.20211010150121.89266/Python-3.10.0/Lib/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/tmp/python-build.20211010150121.89266/Python-3.10.0/python', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmpr0517eeh/setuptools-57.4.0-py3-none-any.whl\', \'/tmp/tmpr0517eeh/pip-21.2.3-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmpr0517eeh\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
make: *** [Makefile:1281: install] Error 1

asdf info output:

OS:
Linux grahamdell 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ASDF VERSION:
v0.8.1-a1ef92a

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/kwilliams/.asdf

ASDF INSTALLED PLUGINS:
python                       https://github.com/danhper/asdf-python.git
TanZng commented 2 years ago

Not sure because I cannot see the full log but make sure to have this install on your machine

sudo apt install libffi-dev libncurses5-dev zlib1g zlib1g-dev
SuperSonicHub1 commented 2 years ago

Ran that command but I'm now running into issues with OpenSSL:

kwilliams@grahamdell:~$ asdf install python 3.10.0 
python-build 3.10.0 /home/kwilliams/.asdf/installs/python/3.10.0
Downloading Python-3.10.0.tar.xz...
-> https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
Installing Python-3.10.0...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems

BUILD FAILED (Ubuntu 20.04 using python-build 2.1.0-12-g5963dc4f)

Inspect or clean up the working tree at /tmp/python-build.20211016195642.141545
Results logged to /tmp/python-build.20211016195642.141545.log

Last 10 log lines:
Installing collected packages: setuptools, pip
  WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/kwilliams/.asdf/installs/python/3.10.0/include/python3.10/setuptools
  sysconfig: /tmp/python-build.20211016195642.141545/Python-3.10.0/Include/setuptools
  WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /home/kwilliams/.asdf/installs/python/3.10.0/include/python3.10/pip
  sysconfig: /tmp/python-build.20211016195642.141545/Python-3.10.0/Include/pip
  WARNING: The scripts pip3 and pip3.10 are installed in '/home/kwilliams/.asdf/installs/python/3.10.0/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.2.3 setuptools-57.4.0

python-build.20211016195642.141545.log

dreyescat commented 2 years ago

To solve the ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? you can install the libssl-dev package:

sudo apt install libssl-dev
SuperSonicHub1 commented 2 years ago

@dreyescat It worked; thanks for the help! For any other Ubuntu users, you'll need some extra libraries for readline, bz2, and sqlite3 to compile.

sudo apt install libreadline-dev libbz2-dev libsqlite3-dev
# You can them immediately uninstall them!
sudo apt remove libreadline-dev libbz2-dev libsqlite3-dev
AllanCapistrano commented 2 years ago

Thank you guys helped me a lot.