如何在App Engine开发服务器(OS X)中导入PyCrypto?

时间:2015-04-08 12:15:37

标签: python google-app-engine pycrypto

我的app.yaml包含以下内容:

libraries:
- name: pycrypto
  version: "2.6"

我有正确的PyCrypto版本:

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

但是,当我尝试在GAE Development SDK交互式控制台中评估import Crypto时,我得到了这个:

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 个答案:

答案 0 :(得分:1)

因为pycrypto包含本机编译代码,所以您需要自己安装Python安装。假设你安装了pip:

pip install pycrypto