0

我正在尝试使用带有此命令的 pyenv 为 python 2.7.18 构建通用二进制文件(x86_64 和 arm64)二进制文件

CFLAGS="-I$(brew --prefix openssl@1.1)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl@1.1)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" arch -x86_64 pyenv install 2.7.18

这是我得到的输出

python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-2.7.18.tar.xz...
-> https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
Installing Python-2.7.18...
patching file configure
patching file configure.ac
patching file setup.py
patching file Mac/Tools/pythonw.c
patching file setup.py
patching file Doc/library/ctypes.rst
patching file Lib/test/test_str.py
patching file Lib/test/test_unicode.py
patching file Modules/_ctypes/_ctypes.c
patching file Modules/_ctypes/callproc.c
patching file Modules/_ctypes/ctypes.h
patching file Modules/_ctypes/callproc.c
patching file setup.py
patching file Mac/Modules/qt/setup.py
patching file setup.py
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python zlib extension was not compiled. Missing the zlib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


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

Inspect or clean up the working tree at /var/folders/fj/mn4vy20j4gl9d_71mf3n3hf00000gn/T/python-build.20220207214945.25127
Results logged to /var/folders/fj/mn4vy20j4gl9d_71mf3n3hf00000gn/T/python-build.20220207214945.25127.log

Last 10 log lines:
rm -f /Users/[...]/.pyenv/versions/2.7.18/share/man/man1/python.1
(cd /Users/[...]/.pyenv/versions/2.7.18/share/man/man1; ln -s python2.1 python.1)
if test "xno" != "xno"  ; then \
        case no in \
            upgrade) ensurepip="--upgrade" ;; \
            install|*) ensurepip="" ;; \
        esac; \
         ./python.exe -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi

有没有其他方法可以将 python 2.7 作为通用或 x86_64 二进制文件?最好是不会破坏自制软件或 macOS 的东西。

我知道 python 2 已被弃用,但 Apple USDConvert 工具仅在 python 2 下运行,Autodesk FBX 和 pxr 插件仅在 x86_64 下运行。Python2 在 macOS 12.3 beta 中从系统中移除,这让事情变得更加复杂。

4

0 回答 0