【问题标题】:How to import PyCrypto inside App Engine development server (OS X)?如何在 App Engine 开发服务器 (OS X) 中导入 PyCrypto?
【发布时间】:2015-04-08 12:15:36
【问题描述】:

我的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

【问题讨论】:

    标签: python google-app-engine pycrypto


    【解决方案1】:

    由于 pycrypto 包含本机编译代码,因此您需要自己安装它以进行 Python 安装。假设你已经安装了 pip:

    pip install pycrypto
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-18
      • 2019-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多