在 MACOS 上安装 python 2.7.8 的 pyenv 失败

问题描述 投票:0回答:1

我尝试为使用此 python 版本的项目安装 python 2.7.8。

但是当我使用命令时:

$ pyenv install 2.7.8 

我收到此错误消息:

python-build: use openssl from homebrew 
python-build: use readline from homebrew 
Downloading Python-2.7.8.tar.xz...
-> https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz 
Installing Python-2.7.8... 
patching file ./Lib/site.py 
patching file ./Lib/ssl.py 
patching file ./Modules/_ssl.c 
python-build: use readline from homebrew 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 (OS X 10.13.6 using python-build 20180424)
        
Inspect or clean up the working tree at /var/folders/xj/fd4h39yj5tn126v2rpf729km0000gn/T/python-build.20200719233445.90241 Results logged to /var/folders/xj/fd4h39yj5tn126v2rpf729km0000gn/T/python-build.20200719233445.90241.log
        
Last 10 log lines: 
(cd /Users/nekcorp/.pyenv/versions/2.7.8/bin; ln -s python2-config python-config) 
test -d /Users/nekcorp/.pyenv/versions/2.7.8/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/nekcorp/.pyenv/versions/2.7.8/lib/pkgconfig
rm -f /Users/nekcorp/.pyenv/versions/2.7.8/lib/pkgconfig/python2.pc 
(cd /Users/nekcorp/.pyenv/versions/2.7.8/lib/pkgconfig; ln -s python-2.7.pc python2.pc) 
rm -f /Users/nekcorp/.pyenv/versions/2.7.8/lib/pkgconfig/python.pc 
(cd /Users/nekcorp/.pyenv/versions/2.7.8/lib/pkgconfig; ln -s python2.pc python.pc) 
rm -f /Users/nekcorp/.pyenv/versions/2.7.8/share/man/man1/python2.1 
(cd /Users/nekcorp/.pyenv/versions/2.7.8/share/man/man1; ln -s python2.7.1 python2.1) 
rm -f /Users/nekcorp/.pyenv/versions/2.7.8/share/man/man1/python.1 
(cd /Users/nekcorp/.pyenv/versions/2.7.8/share/man/man1; ln -s python2.1 python.1)

我已看到描述中的链接,并且已导出 CFLAGS 和 CPPFLAGS 环境变量,但仍然有错误消息。

感谢您的帮助。

python macos pyenv
1个回答
0
投票
  • 卸载现有的 pyenv ->
    brew uninstall pyenv
  • 更新了酿造 ->
    brew update && brew upgrade && brew cleanup && brew doctor
  • 安装了 pyenv ->
    brew install pyenv
  • pyenv init
    中的内容复制到nano ~/.zshrc
  • 安装了openssl 1.1
    brew install [email protected]
  • 现在
    pyenv install -v {version}

这对我有用!

© www.soinside.com 2019 - 2024. All rights reserved.