ImportError:没有名为OpenSSL的模块(python 2.7,windows 8.1)

2024-06-16 10:01:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装了pyOpenSSL和所有必需的包,但无法在shell中导入OpenSSL。我得到这个错误:

>>> import OpenSSL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named OpenSSL

已安装的必需软件包的列表:

cryptography (0.9.3)
distribute (0.7.3)
idna (2.0)
pip (7.1.0)
pyasn1 (0.1.8)
pyasn1-modules (0.0.5)
pyopenssl (0.15.1)
requests (2.7.0)
service-identity (14.0.0)
setuptools (18.1)
six (1.9.0)
Twisted (15.2.1)
urllib3 (1.11)
w3lib (1.12.0)
zope.interface (4.1.2)

Tags: importmost错误stdinlineshellcallfile
1条回答
网友
1楼 · 发布于 2024-06-16 10:01:40

如果您运行的是64位版本的Windows,那么我建议您安装一个Win64版本的OpenSSL,可以从https://slproweb.com/products/Win32OpenSSL.html(向下滚动,直到找到64位安装程序)和64位版本的pyOpenSSL,可以从http://www.egenix.com/products/python/pyOpenSSL/获得

检查您是否没有各种产品、python包等的32位版本。我在PYTHONPATH上有一些站点包,这些站点包混淆了python。我删除了环境变量PYTHONPATH和类似的PYTHONUSERBASE(这两个都是我尝试使用32位版本的mitmproxy的一些软件推荐的,并且都是反向工作的……)。我想保留64位版本的Python(2.7.6),因此当我遇到与您在这里报告的相同错误时,我遇到了一些困难。

相关问题 更多 >