Pyenv will not install any version of python on my system (MacOS M1).
Here's the output from the terminal session:
pyenv install 3.9.0
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.0.tar.xz...
-> https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Installing Python-3.9.0...
patching file Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
patching file configure
patching file configure.ac
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.0.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/rl/lwsby5952zs1d56sjyj0tcn00000gn/T/python-build.20220602111813.90726
Results logged to /var/folders/rl/lwsby5952zs1d56sjyj0tcn00000gn/T/python-build.20220602111813.90726.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.
I tried using the arch
prefix as well:
arch -x86_64 pyenv install 3.8.9
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.9.tar.xz...
-> https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tar.xz
Installing Python-3.8.9...
patching file Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
patching file configure
patching file configure.ac
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.0.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/rl/lwsby5952zs1d56sjyj0tcn00000gn/T/python-build.20220602111231.79341
Results logged to /var/folders/rl/lwsby5952zs1d56sjyj0tcn00000gn/T/python-build.20220602111231.79341.log
Last 10 log lines:
"_libintl_textdomain", referenced from:
_PyIntl_textdomain in libpython3.8.a(_localemodule.o)
_PyIntl_textdomain in libpython3.8.a(_localemodule.o)
ld: symbol(s) not found for architecture x86_64
ld: symbol(s) not found for architecture x86_64
clang: clang: error: error: linker command failed with exit code 1 (use -v to see invocation)
linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_testembed] Error 1
make: *** Waiting for unfinished jobs....
make: *** [python.exe] Error 1
Snippet from .zshrc
:
# Pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
# Pyenv-virtualenv
eval "$(pyenv virtualenv-init -)"
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
Pyenv version: pyenv 2.3.1
Update: Resolved. It was a compatibility issue. pyenv
doesn't support M1 for older versions of python (3.6/3.7/etc). Installing 3.7.13
or 3.10.0
both work.
3.9.0
, the same issue occurs with the younger versions of3.6
,3.7
and so on. – Rufous