简体   繁体   English

无法在使用 miniforge 的 M1 mac 上导入 psutil:(mach-o 文件,但架构不兼容(具有 'x86_64',需要 'arm64e'))

[英]Unable to import psutil on M1 mac with miniforge: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

I'm using a miniforge environment on an M1 mac, and unable to import psutil:我在 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)

I tried uninstalling and reinstalling using pip but that did not work.我尝试使用 pip 卸载并重新安装,但这不起作用。 I'm using python 3.9, OS Monterey 12.2.1我正在使用 python 3.9,OS Monterey 12.2.1

Have you tried:你有没有尝试过:

pip uninstall psutil

followed by:其次是:

pip install --no-binary :all: psutil

Thanks Jude's answer.谢谢裘德的回答。

I encontered ImportError: dlopen...(mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)) when I run Jupyter Lab from new MacBook.当我从新 MacBook 运行 Jupyter Lab 时,我遇到了 ImportError: dlopen...(mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))。

And when trying intall psutil, I got当尝试 intall psutil 时,我得到了

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun error: command '/usr/bin/clang' failed with exit code 1 [end of output] xcrun:错误:无效的活动开发者路径(/Library/Developer/CommandLineTools),在:/Library/Developer/CommandLineTools/usr/bin/xcrun 错误:命令“/usr/bin/clang”失败,退出代码 1 [输出结束]

note: This error originates from a subprocess, and is likely not a problem with pip.注意:此错误源自子进程,可能不是 pip 的问题。 ERROR: Failed building wheel for psutil Failed to build psutil ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects错误:无法为 psutil 构建轮子 无法构建 psutil 错误:无法为 psutil 构建轮子,这是安装基于 pyproject.toml 的项目所必需的

to fix that, I download xcode为了解决这个问题,我下载了 xcode

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 mach-o 文件,但架构不兼容,有 'x86_64',需要 'arm64e' M1 MAC - mach-o file, but is an incompatible architecture have 'x86_64', need 'arm64e' M1 MAC Mac 上的 pyreadstat 导入错误:mach-o 文件,但架构不兼容(具有“x86_64”,需要“arm64e”) - pyreadstat Import Error on Mac: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e') (mach-o 文件,但架构不兼容(有'x86_64',需要'arm64e')) - (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) Python 导入获取mach-o文件,但架构不兼容(有'x86_64',需要'arm64e' M2 Mac - Python Import get mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' M2 Mac “from cplex import *”命令在 VScode 中得到一个错误,说“... mach-o 文件,但是是一个不兼容的架构(有 'x86_64',需要 'arm64e')” - "from cplex import *" command get an Error in VScode saying "... mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')" (mach-o 文件,但它是一个不兼容的架构(有 'arm64',需要 'x86_64')) - (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) 导入错误 confluent_kafka mach-o 文件,但是是不兼容的架构(有(arm64),需要(x86_64))) - import error confluent_kafka mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))) arch x86_64 和 arm64e 可用但 python3 在 Mac M1 上说不兼容的架构 - arch x86_64 and arm64e is available but python3 is saying incompatible architecture on Mac M1 Ortools 安装错误 (x86) - mach-o 文件,但架构不兼容(有 'arm64',需要 'x86_64h') - Error in Ortools installation (x86) - mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h') 尝试在 Atom 中导入 numpy 时出现“不兼容的架构(有 'arm64',需要 'x86_64')”错误 - 'incompatible architecture (have 'arm64', need 'x86_64')' error when trying to import numpy in Atom
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM