运行出现:AttributeError: module 'lib' has no attribute 'Cryptography_HAS_SSL_ST'错误
spoock1024 opened this issue · comments
我使用的是ubuntu16.04,python3.5.2的环境。
使用pip3 install -r requirement.txt没有问题,
但是运行的时候,出现
Traceback (most recent call last): File "filesensor.py", line 7, in <module> from scrapy_project.crawl import run_spider File "/home/spoock/zhihudata/FileSensor/scrapy_project/crawl.py", line 6, in <module> from twisted.internet import reactor File "/usr/local/lib/python3.5/dist-packages/twisted/internet/reactor.py", line 38, in <module> from twisted.internet import default File "/usr/local/lib/python3.5/dist-packages/twisted/internet/default.py", line 56, in <module> install = _getInstallFunction(platform) File "/usr/local/lib/python3.5/dist-packages/twisted/internet/default.py", line 44, in _getInstallFunction from twisted.internet.epollreactor import install File "/usr/local/lib/python3.5/dist-packages/twisted/internet/epollreactor.py", line 24, in <module> from twisted.internet import posixbase File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 18, in <module> from twisted.internet import error, udp, tcp File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 28, in <module> from twisted.internet._newtls import ( File "/usr/local/lib/python3.5/dist-packages/twisted/internet/_newtls.py", line 21, in <module> from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/tls.py", line 41, in <module> from OpenSSL.SSL import Error, ZeroReturnError, WantReadError File "/usr/local/lib/python3.5/dist-packages/OpenSSL/__init__.py", line 8, in <module> from OpenSSL import rand, crypto, SSL File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 112, in <module> if _lib.Cryptography_HAS_SSL_ST: AttributeError: module 'lib' has no attribute 'Cryptography_HAS_SSL_ST'
这样的错误,不知道是什么元婴
刚刚找到了问题,使用pip3 install -r requirement.txt
安装的pyOpenSSL是16.10.1
要使用
sudo pip install pyOpenSSL==0.15.1
安装0.15.1的版本
刚刚测试没有问题了。
good job