本文介绍了如何在App Engine开发服务器(OS X)中导入PyCrypto?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 app.yaml 包含以下几行:

My app.yaml include this lines:

libraries:
- name: pycrypto
  version: "2.6"

我有正确的PyCrypto的版本:

I have the correct version of PyCrypto:

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

但是当我尝试评估在GAE Development SDK交互式控制台中导入Crypto ,我得到:

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


推荐答案

因为pycrypto包含本地编译代码,您需要自己安装它以用于Python安装。假设您已安装pip:

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

pip install pycrypto

这篇关于如何在App Engine开发服务器(OS X)中导入PyCrypto?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 19:14