Python 导入错误:没有名为“加密”的模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39180609/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 21:58:16  来源:igfitidea点击:

ImportError: No module named 'cryptography'

pythonwindowsparamiko

提问by W4hf

I installed python 3.4 on windows 7 and when trying to use paramiko I get this error :

我在 Windows 7 上安装了 python 3.4,尝试使用 paramiko 时出现此错误:

import paramiko

File "C:\Python34\lib\site-packages\paramiko-2.0.2-py3.4.egg\paramiko\__init__.py", line 30, in module

File "C:\Python34\lib\site-packages\paramiko-2.0.2-py3.4.egg\paramiko\transport.py", line 32, in module

ImportError: No module named 'cryptography'

I installed pycrypto-2.6.1.win but the problem persist. Any help ?

我安装了 pycrypto-2.6.1.win 但问题仍然存在。有什么帮助吗?

采纳答案by W4hf

It turned out that it was a proxy problem. It was blocking download. I did

原来是代理问题。它正在阻止下载。我做了

pip install cryptography
pip install paramiko

from a direct internet connection and it worked. Thanks everyone !

从直接的互联网连接,它的工作。谢谢大家 !

回答by BPL

It's not pycryptothe package you need in order to import paramiko, try this:

这不是pycrypto你需要为了进口的paramiko,试试这个软件包:

pip install paramiko

pip 安装paramiko

回答by Lie Ryan

You need to install the cryptography module.

您需要安装加密模块

Normally, dependencies would've automatically got pulled in when you install paramiko using a package manager like pip. How did you install paramiko? Are you installing manually?

通常,当您使用 pip 之类的包管理器安装 paramiko 时,依赖项会自动引入。你是如何安装paramiko的?你是手动安装吗?