简体   繁体   English

fat 文件,但缺少兼容架构有“i386,x86_64”,需要“arm64e”错误与 Mac M1 Pro 芯片上的 bcrypt

[英]fat file, but missing compatible architecture have 'i386,x86_64', need 'arm64e' error with bcrypt on Mac M1 Pro chip

I have recently upgraded from a 2017 MBP to a 2021 MBP with the M1 Pro chip.我最近使用 M1 Pro 芯片从 2017 MBP 升级到 2021 MBP。

Since then i've had issue running a Python 2.7 script.从那时起,我在运行 Python 2.7 脚本时遇到了问题。

I am using paramiko :我正在使用paramiko

#!/usr/bin/env python

...
import paramiko
...

...and when I run the script I get the following error: ...当我运行脚本时出现以下错误:

Traceback (most recent call last):
  File "/Users/crmpicco/deploy.py", line 14, in <module>
    import paramiko
  File "/Library/Python/2.7/site-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/Library/Python/2.7/site-packages/paramiko/transport.py", line 90, in <module>
    from paramiko.ed25519key import Ed25519Key
  File "/Library/Python/2.7/site-packages/paramiko/ed25519key.py", line 17, in <module>
    import bcrypt
  File "/Library/Python/2.7/site-packages/bcrypt/__init__.py", line 25, in <module>
    from bcrypt import _bcrypt
ImportError: dlopen(/Library/Python/2.7/site-packages/bcrypt/_bcrypt.so, 0x0002): tried: '/Library/Python/2.7/site-packages/bcrypt/_bcrypt.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/_bcrypt.so' (no such file)

The file definitely exists, as the error says, but i'm unsure how to proceed.正如错误所说,该文件肯定存在,但我不确定如何继续。

locate bcrypt.so
/Library/Python/2.7/site-packages/bcrypt/_bcrypt.so

The only solution I could find for this was an uninstall and re-install of a bunch of Python packages, name bcrypt, cffi, PyNaCl and cryptography.我能找到的唯一解决方案是卸载并重新安装一堆 Python 包,名称为 bcrypt、cffi、PyNaCl 和密码学。

sudo python2.7 -m pip uninstall bcrypt 
python2.7 -m pip install bcrypt --user

sudo python2.7 -m pip uninstall cffi
python2.7 -m pip install cffi --user

sudo python2.7 -m pip uninstall PyNaCl
python2.7 -m pip install PyNaCl==1.4.0 --user

sudo -H python2.7 -m pip uninstall cryptography
python2.7 -m pip install cryptography --user

暂无
暂无

声明:本站的技术帖子网页,遵循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 无法在使用 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')) 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')) arch x86_64 和 arm64e 可用但 python3 在 Mac M1 上说不兼容的架构 - arch x86_64 and arm64e is available but python3 is saying incompatible architecture on Mac M1 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 文件,但是是一个不兼容的架构(有 &#39;x86_64&#39;,需要 &#39;arm64e&#39;)” - "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')) 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)))
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM