首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法使用pyenv和Homebrew安装Python3.8.13

无法使用pyenv和Homebrew安装Python3.8.13
EN

Ask Ubuntu用户
提问于 2022-06-29 09:14:55
回答 2查看 3.3K关注 0票数 1

我是一个新的Linux学习者。当我试图通过pyenv安装python时,会出现以下错误:

操作系统: Ubuntu 22.04

代码语言:javascript
运行
复制
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
EN

回答 2

Ask Ubuntu用户

发布于 2022-09-28 07:07:10

这个问题是由Homebrew引起的,只需手动卸载和重新安装软件包而不使用Homebrew。

票数 0
EN

Ask Ubuntu用户

发布于 2022-11-04 08:33:20

关于Ubuntu 22 LTS

Pyenv

安装中的K21缺失库问题

在修复之前:

代码语言:javascript
运行
复制
$> pyenv install 3.11.0

指挥结果:

代码语言:javascript
运行
复制
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?

TLDR;

修复方法:

代码语言:javascript
运行
复制
sudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev

结果

修复后:

代码语言:javascript
运行
复制
$> pyenv install 3.11.0

指挥结果:

代码语言:javascript
运行
复制
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
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1416372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档