【发布时间】:2019-03-11 08:10:42
【问题描述】:
我用virtualenv env 创建了一个virtualenv,然后(在采购env/bin/activate 之后)用pip 安装了pusher。但是,每当我尝试运行我的模块时,都会收到此错误:
Traceback (most recent call last):
File "/home/proc-daemon/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/home/proc-daemon/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/home/proc-daemon/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/home/proc-daemon/supachat/supachat.py", line 31, in <module>
ssl=True
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/pusher/pusher.py", line 52, in __init__
json_encoder, json_decoder, backend, **backend_options)
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/pusher/pusher_client.py", line 34, in __init__
json_encoder, json_decoder, backend, **backend_options)
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/pusher/client.py", line 20, in __init__
from .requests import RequestsBackend
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/pusher/requests.py", line 17, in <module>
import urllib3.contrib.pyopenssl
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/OpenSSL/crypto.py", line 12, in <module>
from cryptography import x509
File "/home/proc-daemon/supachat/env/lib/python2.7/site-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
正确安装了所有依赖项,并且ls env/lib/python2.7/site-packages/cryptography/x509 显示(以及其他)certificate_transparency.pyc(和.py)。
是否有其他我没有意识到的安装 pusher 的方法?
【问题讨论】:
-
你确定所有的依赖都安装成功了吗?
-
是的。
Successfully installed asn1crypto-0.24.0 certifi-2018.8.24 cffi-1.11.5 chardet-3.0.4 cryptography-2.3.1 enum34-1.1.6 idna-2.7 ipaddress-1.0.22 markdown-3.0.1 ndg-httpsclient-0.5.1 pusher-2.0.1 pyasn1-0.4.4 pycparser-2.19 pyopenssl-18.0.0 pytz-2018.5 requests-2.19.1 six-1.11.0 urllib3-1.23
标签: python python-2.7 pusher google-app-engine-python