我是一个新的Linux学习者。当我试图通过pyenv安装python时,会出现以下错误:
操作系统: Ubuntu 22.04
kev@kev-Modern-15-A5M:~$ pyenv install 3.8.13
Downloading Python-3.8.13.tar.xz...
-> https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tar.xz
Installing Python-3.8.13...
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 22.04 using python-build 20180424)
Inspect or clean up the working tree at /tmp/python-build.20220629160539.201051
Results logged to /tmp/python-build.20220629160539.201051.log
Last 10 log lines:
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmppnia5_0_
Processing /tmp/tmppnia5_0_/setuptools-56.0.0-py3-none-any.whl
Processing /tmp/tmppnia5_0_/pip-22.0.4-py3-none-any.whl
Installing collected packages: setuptools, pip
WARNING: The scripts pip3 and pip3.8 are installed in '/home/kev/.pyenv/versions/3.8.13/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-22.0.4 setuptools-56.0.0
发布于 2022-09-28 07:07:10
这个问题是由Homebrew引起的,只需手动卸载和重新安装软件包而不使用Homebrew。
发布于 2022-11-04 08:33:20
关于Ubuntu 22 LTS
Pyenv
安装中的K21
缺失库问题
在修复之前:
$> pyenv install 3.11.0
指挥结果:
pyenv: /home/user/.pyenv/versions/3.11.0 already exists
continue with installation? (y/N) y
Downloading Python-3.11.0.tar.xz...
-> https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz
Installing Python-3.11.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?
WARNING: The Python lzma extension was not compiled. Missing the lzma lib?
修复方法:
sudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev
修复后:
$> pyenv install 3.11.0
指挥结果:
pyenv: /home/user/.pyenv/versions/3.11.0 already exists
continue with installation? (y/N) y
Downloading Python-3.11.0.tar.xz...
-> https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz
Installing Python-3.11.0...
Installed Python-3.11.0 to /home/user/.pyenv/versions/3.11.0
https://askubuntu.com/questions/1416372
复制相似问题