Import pycrypto in dev_appserver.py in Google App Engine gives IOError

I am trying to test a Google App Engine application using dev_appserver.py , but when I start import Crypto , I get the following excerpt from the IOError trace (i.e. without access):

 ... import Crypto ... File "/System/Library/Frameworks/Python.framework/Versions /2.7/lib/python2.7/zipfile.py", line 867, in read return self.open(name, "r", pwd).read() File "/System/Library/Frameworks/Python.framework/Versions /2.7/lib/python2.7/zipfile.py", line 882, in open zef_file = open(self.filename, 'rb') File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/ GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google /appengine/tools/dev_appserver_import_hook.py", line 592, in __init__ raise IOError(errno.EACCES, 'file not accessible', filename) IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages /pycrypto-2.3-py2.7-macosx-10.7-intel.egg' 

I am on Mac OS X 10.7, with Google App Engine 1.6.6, using Python 2.7.

Since PyCrypto is supported by the Google App Engine , I expect it to work on the development server.

I know that dev_appserver.py prevents the download of external files. However, I noted that appengine/tools/dev_appserver_import_hook.py seems to contain all the necessary files in the white list (e.g. _fastmath ).

Please note that in app.yaml I have

 libraries: - name: pycrypto version: latest 

It seems that I am missing something obvious, but crucial. Any thoughts would be appreciated.


EDIT For more information see https://code.google.com/p/googleappengine/issues/detail?id=12129

+4
source share
2 answers

Yes, you need to install a third-party library yourself. Google explains which versions it provides on its platform, so this should not be a problem.

+1
source

The best way to get this is to create a virtual environment and install pycrypto inside it. The reason your libraries inside app.yaml not found is most likely due to the fact that several versions of python are installed on your computer, and the version you used to run the program may not be the same version where you installed the libraries

0
source

All Articles