无法在MAC上通过Pyenv安装Python

问题描述 投票:0回答:2

我尝试通过 pyenv 安装 Python 3.9.16 但出现此错误

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
macos pyenv
2个回答
2
投票

与此问题相关

Python 3.9.0 似乎不支持 Apple Silicon。根据发行说明,Python 从 3.9.1 开始支持 Apple Silicon。

已解决:

arch -x86_64 pyenv install 3.8.9

0
投票

请在 Mac 终端上执行以下步骤:

执行命令:

酿酒医生

按照提供的说明解决任何潜在问题。例如,如果在系统前缀处检测到 gettext 文件,这可能会导致编译和链接失败,请采取必要的操作来清理它们。这些文件通常包括:

/usr/local/lib/libgettextlib.dylib /usr/local/lib/libintl.dylib

请删除它们并安装您想要的任何版本的 python。例如,

pyenv 安装 3.11.8

© www.soinside.com 2019 - 2024. All rights reserved.