1

I am trying a GAE Python app on a Windows PC. While using the following code I ran into a No crypto library available error:

from oauth2client.client import SignedJwtAssertionCredentials
json_key=json.load(open('DriveCredentials.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope)

According to this, I need to install PyOpenSSL. I did that but still get the same error. From this Google Groups conversation, it is hypothesized that it won't work in a Windows environment because the crypt module is not available in Windows. Is this correct?

I deployed the project to GAE and it ran fine on Google's server despite not being able to run on my local PC.

Is it a known issue that development on a Windows PC is not possible for SignedJwtAssertionCredentials? Is there a workaround?

I had the same code above in a Python 3.4 environment on Windows in another application earlier and that worked fine.

Community
  • 1
  • 1
Old Geezer
  • 14,854
  • 31
  • 111
  • 198

1 Answers1

1

You need to download and install the Voidspace PyCrypto binaries for Windows:

http://www.voidspace.org.uk/python/modules.shtml#pycrypto

Certain countries have restrictions on exporting cryptography algorithms like PyCrypto. To play it safe, PyCrypto does not offer these directly. Accordingly, you have to download and install it from these third party sites instead of using the standard tools like pip.

speedplane
  • 15,673
  • 16
  • 86
  • 138