我正在使用Anaconda环境进行python。 我使用Anaconda Navigator安装了paramiko(v.2.0.2)和cryptography(v 1.5)模块。 当我尝试执行此import语句时: 进口netmiko 我收到一条错误消息“ImportError:没有名为cryptography.hazmat.backends的模块”
cmd窗口中的总输出为:
>>> import netmiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\__init__.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\ssh_dispatcher.py", line 3, in <module>
File "build\bdist.win-amd64\egg\netmiko\cisco\__init__.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\cisco\cisco_ios_ssh.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\ssh_connection.py", line 3, in <module>
File "build\bdist.win-amd64\egg\netmiko\base_connection.py", line 13, in <module>
File "build\bdist.win-amd64\egg\paramiko\__init__.py", line 30, in <module>
File "build\bdist.win-amd64\egg\paramiko\transport.py", line 32, in <module>
ImportError: No module named cryptography.hazmat.backends
有谁知道如何解决这个问题? 任何帮助表示赞赏。
答案 0 :(得分:2)
我猜命令的正确顺序是:
#apt-get update
#apt-get install python-dev
#apt-get install libffi-dev
#pip install cryptography
它在我的案例中解决了这个问题
答案 1 :(得分:0)
您可能遇到问题,因为您没有安装libffi-dev。安装&#34; python-dev&#34;和&#34; libffi-dev&#34;在OS层可能有帮助。