How to import PyCrypto inside App Engine developme

2019-09-16 20:10发布

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条回答
Juvenile、少年°
2楼-- · 2019-09-16 20:36

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

pip install pycrypto
查看更多
登录 后发表回答