How to import PyCrypto inside App Engine development server (OS X)?

梦想与她 提交于 2019-12-25 14:07:45

问题


My app.yaml include this lines:

libraries:
- name: pycrypto
  version: "2.6"

I have the correct version of PyCrypto:

$ python
>>> import Crypto
>>> Crypto.__version__
'2.6'

But when I try evaluate import Crypto in GAE Development SDK interactive console, I get this:

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 225, in handle_interactive_request
    exec(compiled_code, self._command_globals)
  File "<string>", line 12, in <module>
ImportError: No module named Crypto

回答1:


Because pycrypto includes native compiled code, you need to install that yourself for your Python installation. Assuming you have pip installed:

pip install pycrypto


来源:https://stackoverflow.com/questions/29514344/how-to-import-pycrypto-inside-app-engine-development-server-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!