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
我最近使用 M1 Pro 芯片从 2017 MBP 升级到 2021 MBP。
从那时起我就遇到了 运行ning Python 2.7 脚本的问题。
我正在使用 paramiko:
#!/usr/bin/env python
...
import paramiko
...
...当我 运行 脚本时出现以下错误:
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)
文件确实存在,正如错误所说,但我不确定如何继续。
locate bcrypt.so
/Library/Python/2.7/site-packages/bcrypt/_bcrypt.so
我能找到的唯一解决方案是卸载和 re-install 一堆 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
我最近使用 M1 Pro 芯片从 2017 MBP 升级到 2021 MBP。
从那时起我就遇到了 运行ning Python 2.7 脚本的问题。
我正在使用 paramiko:
#!/usr/bin/env python
...
import paramiko
...
...当我 运行 脚本时出现以下错误:
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)
文件确实存在,正如错误所说,但我不确定如何继续。
locate bcrypt.so
/Library/Python/2.7/site-packages/bcrypt/_bcrypt.so
我能找到的唯一解决方案是卸载和 re-install 一堆 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