Google App Engine cannot find gdata module

I can run the simple Hello App Google App Engine application on the local host without any problems. However, when I add the line "import gdata.auth" to my Python script, I get "ImportError: There is no module named gdata.auth".

I installed the gdata module and added the following line to my .bashrc:

  export PYTHONPATH = $ PYTHONPATH: /Library/Python/2.5/site-packages/ 

Is there anything else I need to do? Thanks.

EDIT: It is strange that if I run python from the shell and type "import gdata.auth", I do not get an error.

+4
source share
3 answers

Your .bashrc is unknown to the Google App Engine. Make sure the gdata directory (with all its relevant contents) is in the main directory of your application!

See this article in particular (and quote):

To use this library using the Google App Engine, simply place the library source files in your application directory and import as usual. The source directories that you need to download using your application code are src / gdata and src / atom. Then be sure to call the gdata.alt.appengine.run_on_appengine function on each gdata.service.GDataService instance. There is nothing more than that!

+9
source

Installing the gdata client library script is installing modules in the wrong directory for installing python ubuntu.

 sudo mv /usr/local/lib/python2.6/dist-packages/* /usr/lib/python2.6/dist-packages 
+1
source

try adding this to your script:

 import sys sys.path.append('<directory where gdata.auth module is saved>') import gdata.auth 
0
source

Source: https://habr.com/ru/post/1286650/


All Articles