MacOSX上的pyenv和poetry安装

2024-09-30 20:33:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在运行Big Sur的Macbook Pro上安装pyenv和poetry

我遵循了所有我可以在网上找到的说明和帮助,但在尝试使用pyenv install 3.9.0安装全局Python版本时遇到了麻烦

这只会产生以下输出:

pyenv install 3.9.0
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.0.tar.xz...
-> https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Installing Python-3.9.0...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 11.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/_3/3n7g_jr918v2cj_pkdlfk5t40000gn/T/python-build.20210619130847.19436
Results logged to /var/folders/_3/3n7g_jr918v2cj_pkdlfk5t40000gn/T/python-build.20210619130847.19436.log

Last 10 log lines:
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/_3/3n7g_jr918v2cj_pkdlfk5t40000gn/T/python-build.20210619130847.19436/Python-3.9.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

我创建了以下内容并将其添加到我的主文件夹中的.zprofile文件中-重新启动的shell,尽管在macosx上似乎不需要这样做…:


cat .zprofile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"

命令行C编译器UTIL是为XCode安装的


Tags: installnofrombuildlogpyenvforreadline