Search code examples
macospyenv

Can't install Python through Pyenv on MAC


I'm trying to install Python 3.9.16 through pyenv but get this error

Traceback (most recent call last):
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/ensurepip/__init__.py", line 211, in _main
return _bootstrap(
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/ensurepip/__init__.py", line 130, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/ensurepip/__init__.py", line 39, in _run_pip
return subprocess.run(cmd, check=True).returncode
File "/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/Lib/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/python-build.20230508142345.28952/Python-3.9.16/python.exe', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/tmp45llfbar/setuptools-58.1.0-py3-none-any.whl\', \'/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/tmp45llfbar/pip-22.0.4-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/yv/mbl800td04xb4pd9hctdshd00000gn/T/tmp45llfbar\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' died with <Signals.SIGABRT: 6>.
make: *** [install] Error 1

Solution

  • Related to this issue

    Python 3.9.0 don't seem to support Apple Silicon. According to release note, python support Apple Silicon from 3.9.1.

    SOLVED with:

    arch -x86_64 pyenv install 3.8.9