添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I trying to build older version of python such as 3.6, 3.7, 3.8 using pyenv and having build failures. I am on apple silicon and the last macOS 12.3.1. In older OS these versions would build fine. Following is the failure I get running pyenv install 3.6.9

python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.3.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/sn/46fncn513kng4ssgwn398m5h0000gn/T/python-build.20220403110510.8666
Results logged to /var/folders/sn/46fncn513kng4ssgwn398m5h0000gn/T/python-build.20220403110510.8666.log
Last 10 log lines:
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:
  By default, distutils will build C++ extension modules with "clang++".
  If this is not intended, then set CXX on the configure command line.
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found.  Stop.
        

I tried to build these versions from the source and still get build failure. For example building 3.6.9 from source results in the following.

./configure checking build system type... arm-apple-darwin21.4.0 checking host system type... arm-apple-darwin21.4.0 checking for python3.6... no checking for python3... python3 checking for --enable-universalsdk... no checking for --with-universal-archs... no checking MACHDEP... darwin checking for --without-gcc... no checking for --with-icc... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for a sed that does not truncate output... /usr/bin/sed checking for --with-cxx-main=... no checking for g++... no configure:

By default, distutils will build C++ extension modules with "g++". If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... darwin configure: error: internal configure error for the platform triplet, please file a bug report

Using pyenv 2.25 from homebrew on Apple Silicon with macOS 12.3.1 (21E258) / Xcode 13.3 (13E113).

For 3.6.15 you'll need this merged but unreleased pyenv patch: https://raw.githubusercontent.com/pyenv/pyenv/master/plugins/python-build/share/python-build/patches/3.6.15/Python-3.6.15/0008-bpo-45405-Prevent-internal-configure-error-when-runn.patch in /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/share/python-build/patches/3.6.15/Python-3.6.15/

For 3.7.12 you'll need this merged but unreleased pyenv patch: https://raw.githubusercontent.com/pyenv/pyenv/master/plugins/python-build/share/python-build/patches/3.7.12/Python-3.7.12/0004-bpo-45405-Prevent-internal-configure-error-when-runn.patch in /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/share/python-build/patches/3.7.12/Python-3.7.12/

3.7.13 is unreleased and currently missing merged 3.7.12 patch.

https://github.com/pyenv/pyenv/tree/fb97a9c2bd8c0e7b582d4b525cd348cc2ed5359a/plugins/python-build/share/python-build/patches/3.7.13/Python-3.7.13

No issues with 3.8.13 build.

pyenv versions
* system (set by /Users/admin/.pyenv/version)
 3.6.15
 3.7.12
 3.8.13
        

Hi, I have a MacBook pro M1 2021 with macOS 12.3.1

I'm not able to install python 3.6.8 either 3.6.15. could you please explain step by step how to install some of those versions?

Thanks !

I'm trying to build 3.6.15 on my M1 using pyenv 2.2.5. I applied the patch listed above by @mikeyh, but I still get errors during the build:

  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/cli/main_parser.py", line 12, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 18, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/download.py", line 38, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>  File "/private/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/python-build.20220509143451.90455/Python-3.6.15/Lib/ctypes/__init__.py", line 7, in <module>   from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes'

Any way around that?

Using pyenv 2.25 from homebrew on Apple Silicon with macOS 12.3.1 (21E258) / Xcode 13.3 (13E113).

For 3.6.15 you'll need this merged but unreleased pyenv patch: https://raw.githubusercontent.com/pyenv/pyenv/master/plugins/python-build/share/python-build/patches/3.6.15/Python-3.6.15/0008-bpo-45405-Prevent-internal-configure-error-when-runn.patch in /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/share/python-build/patches/3.6.15/Python-3.6.15/

For 3.7.12 you'll need this merged but unreleased pyenv patch: https://raw.githubusercontent.com/pyenv/pyenv/master/plugins/python-build/share/python-build/patches/3.7.12/Python-3.7.12/0004-bpo-45405-Prevent-internal-configure-error-when-runn.patch in /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/share/python-build/patches/3.7.12/Python-3.7.12/

3.7.13 is unreleased and currently missing merged 3.7.12 patch.

https://github.com/pyenv/pyenv/tree/fb97a9c2bd8c0e7b582d4b525cd348cc2ed5359a/plugins/python-build/share/python-build/patches/3.7.13/Python-3.7.13

No issues with 3.8.13 build.

pyenv versions
* system (set by /Users/admin/.pyenv/version)
 3.6.15
 3.7.12
 3.8.13
        

Hi, I have a MacBook pro M1 2021 with macOS 12.3.1

I'm not able to install python 3.6.8 either 3.6.15. could you please explain step by step how to install some of those versions?

Thanks !

I'm trying to build 3.6.15 on my M1 using pyenv 2.2.5. I applied the patch listed above by @mikeyh, but I still get errors during the build:

  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/cli/main_parser.py", line 12, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 18, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/download.py", line 38, in <module>  File "/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/tmpgmrcdbol/pip-18.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>  File "/private/var/folders/41/gktcdg9x6d38d7jhzg09nwsh0000gn/T/python-build.20220509143451.90455/Python-3.6.15/Lib/ctypes/__init__.py", line 7, in <module>   from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes'

Any way around that?

This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Developer Forums Participation Agreement.
  • Forums
  • Terms of Use Privacy Policy License Agreements