Python 3 installation fails in pyenv

Asked 2 years ago, Updated 2 years ago, 110 views

macOS High Sierra 10.13.2.

pyenv install 3.6.4

The following error occurs:

BUILD FAILED (OS X 10.13.2 using python-build 20160602)

Inspector clean up the working tree at /var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/python-build.20180116170918.43667
Results logged to/var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/python-build.20180116170918.43667.log

Last 10 log lines:
    import pip
  File"/var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/tmp7a7v0c9u/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 26, in <module>
  File"/var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/tmp7a7v0c9u/pipe-9.0.1-py2.py3-none-any.whl/pipe/utils/__init__.py", line 27, in <module>
  File"/var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/tmp7a7v0c9u/pipe-9.0.1-py2.py3-none-any.whl/pipe/_vendor/pkg_resources/_init___.py", line 35, in <module>
  File"/private/var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/python-build.20180116170918.43667/Python-3.6.4/Lib/plistlib.py", line 65, in <module>
    from xml.parsers.expatimportParserCreate
  File "/private/var/folder/66/rr7sz_v92mbcdzrw1yj8md0h0000gq/T/python-build.20180116170918.43667/Python-3.6.4/Lib/xml/parser/expat.py", line 4, in <module>
    from pyexpat import*
ModuleNotFoundError: No module named 'pyexpat'
make:***[install] Error 1

The error is similar even if you do the following:

CFLAGS="-I$(xcrun --show-sdk-path)/usr/include"pienv install 3.6.4

This is still an error.

CFLAGS="-I$(brew--prefix openssl)/include "LDFLAGS="-L$(brew--prefix openssl)/lib"pienv install-v 3.6.4

I tried from 3.6.1 to 3.6.4, but I got the same error.
The Xcode command-line tool is installed.

If anyone knows how to solve it, please let me know.
Thank you for your cooperation.

python macos pyenv

2022-09-30 20:21

1 Answers

I was troubled by the same error, but I solved it by the method in the comment of jklem on the link below.
I did it on OS 10.13.6 and installed it without any problems.

unset CFLAGS
brew install pyenv readline xz
pyenv install {{version}}}

https://github.com/pyenv/pyenv/issues/1066#issuecomment-387211005

This may occur after the migration with the Migration Assistant.


2022-09-30 20:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.