ImportError:GAE中没有名为_openssl的模块

时间:2015-11-20 12:18:23

标签: python-2.7

Actually I am uploading python app (which using pusher module) on GAE. Its working fine on my local system. But in GAE(Google App Engine) Its giving following error when I host this app to GAE.

Traceback (most recent call last): (/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/cgi.py:122)

  File "/base/data/home/apps/s~pushapi-1117/1.388696378960329626/main.py", line 
       26, in <module>
       secret=secret

  File "lib/pusher/pusher.py", line 42, in __init__    from pusher.requests 
       import RequestsBackend

  File "lib/pusher/requests.py", line 12, in <module>
       import urllib3.contrib.pyopenssl

  File "lib/urllib3/contrib/pyopenssl.py", line 53, in <module>
       import OpenSSL.SSL

  File "lib/OpenSSL/__init__.py", line 8, in <module>
       from OpenSSL import rand, crypto, SSL

  File "lib/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (

  File "lib/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding

  File "lib/cryptography/hazmat/bindings/openssl/binding.py", line 13, in 
       <module>
       from cryptography.hazmat.bindings._openssl import ffi, lib

       **ImportError: No module named _openssl**

我已经安装了所有依赖模块加密,OpenSSL也随后我也遇到了这个问题。只有当我在GAE上托管我的应用程序时才会出现此错误。

1 个答案:

答案 0 :(得分:0)

GAE不支持C扩展和pyca / cryptography(pyOpenSSL依赖)导入C扩展(通过cffi)。 Google提供了有关requirements for Python libraries on GAE的更多信息。