1

I am following this tutorial on Google Cloud Endpoints. I am having trouble at the "Generating the OpenApi configuration file" section. Specifically, when I invoke the Endpoints tool.

The Traceback is saying that the file on lib/Crypto/Random/init.py "from Crypto.Random import OSRNG" is producing the import error.

What I have done so far

  1. Looked at the path lib/Crypto/Random and saw a folder named OSRNG - thus made sure that there was a folder called OSRNG (I didnt see any py file name OSRNG.py though)
  2. Followed the answer for this question by putting the pycrypto version to "latest" in the app.yaml file.
  3. Looked into this question but doesnt apply.
  4. Looked into this question by specifying the version rather than "latest" in app.yaml.

I don't understand why it is saying there is an import error when I can literally see the package/module in the directory.

Can someone help why it is producing an import error?

Gil
  • 515
  • 2
  • 10
  • 24
  • What is the result of this command? `echo $ENDPOINTS_GAE_SDK`. It should be `/usr/lib/google-cloud-sdk/platform/google_appengine`, as mentioned [in step 11](https://cloud.google.com/endpoints/docs/frameworks/python/get-started-frameworks-python#before-you-begin). – Mangu May 04 '18 at 11:12
  • hi @Mangu yeap, I did that. However, the sdk isnt installed in /usr/lib like yours. it is just installed in ~/home/gilho/ . Didn think that was a problem. – Gil May 05 '18 at 05:08
  • Did changing the location of the SDK solved the issue? – Mangu May 07 '18 at 07:03
  • i will give it a go. Would be weird if it worked because the documentation said that it doesnt matter where the sdk is installed – Gil May 11 '18 at 04:21

1 Answers1

0

Are you running on OSX? I encountered a similar problem and the solution for me was installing google-endpoints (which for some reason is missing from the instructions):

pip install -t lib google-endpoints --ignore-installed

Yuval Sapir
  • 166
  • 1
  • 4
  • Im running ubuntu. I did that (installing google-endpoints). still no luck. – Gil May 02 '18 at 10:23
  • I'm hitting the same problem: echo $ENDPOINTS_GAE_SDK returns empty string I've installed: pip install -t lib google-endpoints --ignore-installed in both -t lib and in my local virtual env not sure what to try next?? – Dewey Mar 06 '19 at 21:44