簡體   English   中英

無法在 MacOS 11.1 上使用 pyenv 安裝 Python 構建與共享庫

[英]Unable to install Python build with shared library using pyenv on MacOS 11.1

我在嘗試安裝 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

我得到相同的 output。

我也試過這個:

$ brew install zlib
$ export LDFLAGS="-L/usr/local/opt/zlib/lib"
$ export CPPFLAGS="-I/usr/local/opt/zlib/include

唉,無濟於事。

有任何想法嗎? 謝謝~

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM