ModuleNotFoundError:没有名为"OpenSSL"的模块 [英] ModuleNotFoundError: No module named 'OpenSSL'

查看:154
本文介绍了ModuleNotFoundError:没有名为"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命令,例如pip3pip2.)

(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆