由于M1芯片
在不使用root权限安装 paramiko时,可以安装成功但使用时会报错
查询m1芯片不兼容问题,查找paramiko安装依赖包 pycparser
sudo pip3 install paramiko
Password:
WARNING: The directory '/Users/sirius/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: paramiko in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (2.12.0)
Requirement already satisfied: pynacl>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (1.5.0)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (1.16.0)
Requirement already satisfied: bcrypt>=3.1.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (3.2.2)
Requirement already satisfied: cryptography>=2.5 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (37.0.3)
Requirement already satisfied: cffi>=1.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from bcrypt>=3.1.3->paramiko) (1.15.0)
Requirement already satisfied: pycparser in /Library/Frameworks/Python.framewor
卸载相关依赖
sudo pip3 uninstall cffi
sudo pip3 uninstall pycparser
重新安装
sirius@siriusdeMacBook-Air cttest2 % sudo pip3 install paramiko
WARNING: The directory '/Users/sirius/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting paramiko
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/71/6d/95777fd66507106d2f8f81d005255c237187951644f85a5bd0baeec8a88f/paramiko-2.12.0-py2.py3-none-any.whl (213 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 213.1/213.1 KB 452.9 kB/s eta 0:00:00
Requirement already satisfied: cryptography>=2.5 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (37.0.3)
Requirement already satisfied: pynacl>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (1.5.0)
Requirement already satisfied: bcrypt>=3.1.3 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (3.2.2)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from paramiko) (1.16.0)
Collecting cffi>=1.1
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e8/ff/c4b7a358526f231efa46a375c959506c87622fb4a2c5726e827c55e6adf2/cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl (179 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.2/179.2 KB 389.6 kB/s eta 0:00:00
Collecting pycparser
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl (118 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 KB 234.6 kB/s eta 0:00:00
Installing collected packages: pycparser, cffi, paramiko
Successfully installed cffi-1.15.1 paramiko-2.12.0 pycparser-2.21
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m pip install --upgrade pip' command.
测试:一切正常
sirius@siriusdeMacBook-Air cttest2 % python3
Python 3.10.4 (v3.10.4:9d38120e33, Mar 23 2022, 17:29:05) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import paramiko