Google App Engine cannot find gdata module

后端 未结 3 1281
余生分开走
余生分开走 2021-01-13 14:53

I can run a simple \"Hello World\" Google App Engine application on localhost with no problems. However, when I add the line \"import gdata.auth\" to my Python script I get

相关标签:
3条回答
  • 2021-01-13 15:22

    try adding this to your script:

    import sys
    sys.path.append('<directory where gdata.auth module is saved>')
    import gdata.auth
    
    0 讨论(0)
  • 2021-01-13 15:25

    The gdata client library installation script installs the modules in the wrong directory for ubuntu python installation.

    sudo mv /usr/local/lib/python2.6/dist-packages/* /usr/lib/python2.6/dist-packages
    
    0 讨论(0)
  • 2021-01-13 15:30

    Your .bashrc is not known to Google App Engine. Make sure the gdata directory (with all its proper contents) is under your application's main directory!

    See this article, particularly (and I quote):

    To use this library with your Google App Engine application, simply place the library source files in your application's directory, and import them as you usually would. The source directories you need to upload with your application code are src/gdata and src/atom. Then, be sure to call the gdata.alt.appengine.run_on_appengine function on each instance of a gdata.service.GDataService object. There's nothing more to it than that!

    0 讨论(0)
提交回复
热议问题