![](/img/trans.png)
[英]mach-o file, but is an incompatible architecture have 'x86_64', need 'arm64e' M1 MAC
[英]Unable to import psutil on M1 mac with miniforge: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
我在 M1 mac 上使用 miniforge 环境,无法导入 psutil:
ImportError: dlopen(/Users/caspsea/miniforge3/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so, 0x0002): tried: '/Users/caspsea/miniforge3/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_psutil_osx.cpython-39-darwin.so' (no such file), '/usr/lib/_psutil_osx.cpython-39-darwin.so' (no such file)
我尝试使用 pip 卸载并重新安装,但这不起作用。 我正在使用 python 3.9,OS Monterey 12.2.1
你有没有尝试过:
pip uninstall psutil
其次是:
pip install --no-binary :all: psutil
谢谢裘德的回答。
当我从新 MacBook 运行 Jupyter Lab 时,我遇到了 ImportError: dlopen...(mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))。
当尝试 intall psutil 时,我得到了
xcrun:错误:无效的活动开发者路径(/Library/Developer/CommandLineTools),在:/Library/Developer/CommandLineTools/usr/bin/xcrun 错误:命令“/usr/bin/clang”失败,退出代码 1 [输出结束]
注意:此错误源自子进程,可能不是 pip 的问题。 错误:无法为 psutil 构建轮子 无法构建 psutil 错误:无法为 psutil 构建轮子,这是安装基于 pyproject.toml 的项目所必需的
为了解决这个问题,我下载了 xcode
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.