ModuleNotFoundError:没有名为"OpenSSL"的模块 [英] ModuleNotFoundError: No module named 'OpenSSL'
问题描述
在Python 3.6中,我得到了ModuleNotFoundError
:
In Python 3.6 I am getting a ModuleNotFoundError
:
>>> import OpenSSL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'OpenSSL'
为什么Python无法找到OpenSSL模块?
Why can't Python find the OpenSSL module?
推荐答案
OpenSSL
模块来自pyOpenSSL库.您可以使用以下命令通过Pip安装它:
The OpenSSL
module comes from the pyOpenSSL library. You can install it with Pip using a command like:
pip install pyOpenSSL
如果由于缺少依赖项而失败,请参阅此如何安装OpenSSL的答案中有关安装pyOpenSSL依赖项的说明.对于Python" .
If it fails due to missing dependencies, see the instructions on installing pyOpenSSL's dependencies in this answer to "How to install OpenSSL for Python".
(此外,与所有pip安装一样,根据您的环境,您可能需要在pip
之前写sudo
才能以root用户身份运行,并且可能需要使用特定于版本的pip命令,例如pip3
或pip2
.)
(Also, as with all pip installs, depending upon your environment, you may need to write sudo
before pip
to run as root, and you may need to use a version-specific pip command like pip3
or pip2
.)
这篇关于ModuleNotFoundError:没有名为"OpenSSL"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!