我尝试为使用此 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 环境变量,但仍然有错误消息。
感谢您的帮助。
brew uninstall pyenv
brew update && brew upgrade && brew cleanup && brew doctor
brew install pyenv
pyenv init
中的内容复制到nano ~/.zshrcbrew install [email protected]
pyenv install -v {version}
这对我有用!