当我尝试使用 asdf 版本管理器安装 Python 3.8.18 时,我不断收到奇怪的错误

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

我正在尝试使用

python 3.8.18
安装
asdf

我正在使用这个命令

asdf install python 3.8.18

但是,我不断收到此错误

python-build 3.8.18 /Users/frank/.asdf/installs/python/3.8.18
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.18.tar.xz...
-> https://www.python.org/ftp/python/3.8.18/Python-3.8.18.tar.xz
Installing Python-3.8.18...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 15.1 using python-build 2.4.19-1-g61c0f25e)

Inspect or clean up the working tree at /var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503
Results logged to /var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503.log

Last 10 log lines:
  File "/private/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503/Python-3.8.18/Lib/ensurepip/__init__.py", line 209, in _main
    return _bootstrap(
  File "/private/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503/Python-3.8.18/Lib/ensurepip/__init__.py", line 128, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503/Python-3.8.18/Lib/ensurepip/__init__.py", line 37, in _run_pip
    return subprocess.run(cmd, check=True).returncode
  File "/private/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503/Python-3.8.18/Lib/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/python-build.20241124182312.89503/Python-3.8.18/python.exe', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/tmpc28ood9w/setuptools-56.0.0-py3-none-any.whl\', \'/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/tmpc28ood9w/pip-23.0.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/yp/d4ldg85x4pv4lw72m44bpzr40000gn/T/tmpc28ood9w\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
make: *** [install] Error 1

我尝试过跑步

brew install [email protected] readline xz zlib
asdf update
asdf plugin update python
但错误仍然存在,我仍然不确定为什么

python homebrew asdf
1个回答
0
投票

我可以在您发布的错误消息中看到

BUILD FAILED (OS X 15.1 using python-build 2.4.19-1-g61c0f25e)
,所以看起来您正在使用
Macbook
。根据我的经验,大多数此类错误始终与系统架构有关。我猜你正在尝试在
arm
架构(即 M1、M2 等)上安装 python。我建议尝试将其安装在
intel
架构上。

所以基本上,打开你的终端并:

  • 奔跑
    env /usr/bin/arch -x86_64 /bin/zsh --login
  • 奔跑
    asdf install python 3.8.18 again
© www.soinside.com 2019 - 2024. All rights reserved.