gpt4 book ai didi

python - 无法在 MacOS 11.1 上使用 pyenv 安装带有共享库的 Python 构建

转载 作者:行者123 更新时间:2023-12-04 15:03:37 28 4
gpt4 key购买 nike

我在尝试安装启用了共享库的 Python 3.8.6 时遇到错误。我在 M1 Macbook Pro 上使用 PyEnv 1.2.23。
特别是,运行:

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.8.6
返回错误信息:
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.6.tar.xz...
-> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz
Installing Python-3.8.6...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 11.1 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/python-build.20210309124942.97911
Results logged to /var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/python-build.20210309124942.97911.log

Last 10 log lines:
checking size of _Bool... 1
checking size of off_t... 8
checking whether to enable large file support... no
checking size of time_t... 8
checking for pthread_t... yes
checking size of pthread_t... 8
checking size of pthread_key_t... 8
checking whether pthread_key_t is compatible with int... no
configure: error: Unexpected output of 'arch' on OSX
make: *** No targets specified and no makefile found. Stop.
我也试过:
$ arch -x86_64 env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.8.6
我得到相同的输出。
我也试过这个:
$ brew install zlib
$ export LDFLAGS="-L/usr/local/opt/zlib/lib"
$ export CPPFLAGS="-I/usr/local/opt/zlib/include
唉,无济于事。
有任何想法吗?谢谢~

最佳答案

M1 支持直到 3.9.1 才添加到 Python。你需要升级。

关于python - 无法在 MacOS 11.1 上使用 pyenv 安装带有共享库的 Python 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66555053/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com