Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while installing Python on Ubuntu 20.04 #119

Open
LukeSamkharadze opened this issue Nov 30, 2021 · 15 comments
Open

Error while installing Python on Ubuntu 20.04 #119

LukeSamkharadze opened this issue Nov 30, 2021 · 15 comments

Comments

@LukeSamkharadze
Copy link

Clean install of Ubuntu 20.04.

Only installed asdf build-essentials and nodejs from asdf

asdf install python latest
python-build 3.10.0 /home/luke/.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...
patching file aclocal.m4
patching file configure
Hunk #5 succeeded at 10537 (offset -15 lines).

BUILD FAILED (Ubuntu 20.04 using python-build 2.2.2-1-gf2925393)

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

Last 10 log lines:
  File "/tmp/python-build.20211130154109.31205/Python-3.10.0/Lib/ensurepip/__init__.py", line 277, in _main
    return _bootstrap(
  File "/tmp/python-build.20211130154109.31205/Python-3.10.0/Lib/ensurepip/__init__.py", line 193, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "/tmp/python-build.20211130154109.31205/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.20211130154109.31205/Python-3.10.0/Lib/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/tmp/python-build.20211130154109.31205/Python-3.10.0/python', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmp62rz_rq2/setuptools-57.4.0-py3-none-any.whl\', \'/tmp/tmp62rz_rq2/pip-21.2.3-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmp62rz_rq2\', \'--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
@LukeSamkharadze
Copy link
Author

Probably related to #118

@web3nft
Copy link

web3nft commented Dec 19, 2021

having similar issue. running asdf install python 3.10.1

BUILD FAILED (Ubuntu 20.04 using python-build 2.2.2-10-g943c5f99)

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

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

@web3nft
Copy link

web3nft commented Dec 25, 2021

Manage to install python with asdf now.
need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

@LukeSamkharadze
Copy link
Author

Thanks it worked.

But I think issue still should be opened as those dependencies should be installed automatically by asdf python plugin or at least let us now about them

@AllanCapistrano
Copy link

I had the same issue and solved it using the following commands:

sudo apt install libffi-dev libncurses5-dev zlib1g zlib1g-dev
sudo apt install libssl-dev
sudo apt install libreadline-dev libbz2-dev libsqlite3-dev

@stephanschielke
Copy link

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

Works for Ubuntu 22:04 as well!

@hunj
Copy link

hunj commented May 24, 2022

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Worked for me too!

@c2karansingh
Copy link

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

Can confirm, this works

@pulecp
Copy link

pulecp commented Jul 24, 2023

💡

Results logged to /tmp/python-build.20211130154109.31205.log

I recommend to check the log file that is created. There you can see why the build failed. The last 10 log lines is not enough.

@itsahedge
Copy link

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

this fixed it thanks.

@gelodefaultbrain
Copy link

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

I can confirm this works! With WSL as well on Ubuntu 22.04

@anandkkpr
Copy link

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

Confirmed working on PopOS (Ubuntu) 22.04 today (2024-02-14). Thank you!

@muriloanjos99
Copy link

Manage to install python with asdf now. need to install packages below, before trying to install python

sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I must have missed some packages

It worked here too (Ubuntu 22.04)!

@dgchrt
Copy link

dgchrt commented May 7, 2024

One liner solution (thanks to @AllanCapistrano for the shorter list of dependencies):

sudo apt install libffi-dev libncurses5-dev zlib1g zlib1g-dev libssl-dev libreadline-dev libbz2-dev libsqlite3-dev

Then once asdf install python runs successfully, it is also possible to remove those -dev packages right after.

@regtm
Copy link

regtm commented Jul 31, 2024

The issue still seems relevant, so here are the rpm dependencies:

sudo dnf groupinstall "Development Tools" -y
sudo dnf install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel libffi-devel findutils -y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests