Ubuntu 安装paramiko时候报错。
root/root# python3 xxx.py
Traceback (most recent call last):
File "xxx.py", line 4, in <module>
import paramiko
ModuleNotFoundError: No module named 'paramiko'
root/root# pip3 install paramiko
Collecting paramiko
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/56/7c/9dd558ec0869fcecb661765d0a2504978dbfe85de24cbcccc847aa9b58e4/paramiko-3.1.0-py3-none-any.whl (211kB)
100% |████████████████████████████████| 215kB 20.3MB/s
Collecting cryptography>=3.3 (from paramiko)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/fa/f3/f4b8c175ea9a1de650b0085858059050b7953a93d66c97ed89b93b232996/cryptography-39.0.2.tar.gz (604kB)
100% |████████████████████████████████| 614kB 35.6MB/s
Complete output from command python setup.py egg_info:
/usr/local/lib/python3.6/dist-packages/setuptools/dist.py:726: UserWarning: Usage of dash-separated 'index-url' will not be supported in future versions. Please use the underscore name 'index_url' instead
% (opt, underscore_opt)
/usr/lib/python3.6/importlib/__init__.py:126: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
return _bootstrap._gcd_import(name[level:], package, level)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-kts8f25b/cryptography/setup.py", line 63, in <module>
rust_version=">=1.48.0",
File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/local/lib/python3.6/dist-packages/setuptools/dist.py", line 463, in __init__
for k, v in attrs.items()
File "/usr/lib/python3.6/distutils/dist.py", line 261, in __init__
warnings.warn(msg)
UserWarning: Unknown distribution option: 'cffi_modules'
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.6.9
platform: Linux-4.15.0-163-generic-x86_64-with-Ubuntu-18.04-bionic
pip: 9.0.1
setuptools: 59.6.0
setuptools_rust: 1.1.2
rustc: n/a
=============================DEBUG ASSISTANCE=============================
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kts8f25b/cryptography/
当前提示是说 Unknown distribution option: ‘cffi_modules’
未知的分发选项:“cffi_modules”
解决:
1.pip3 install cffi
2.pip install --upgrade pip
3.再次pip3 install paramiko
搞定。