[英]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.