Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Importing Gdata Lib in Google App Engine
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
klenwell  
View profile  
 More options Jan 30 2010, 3:36 pm
From: klenwell <klenw...@gmail.com>
Date: Sat, 30 Jan 2010 12:36:15 -0800 (PST)
Local: Sat, Jan 30 2010 3:36 pm
Subject: Importing Gdata Lib in Google App Engine
I'm not using setup.py install but rather have the gdata and atom
package inside a third-party directory for my application.

Importing the atom package works fine.  For example:
from vendor.google import atom

But when I try:
from vendor.google import gdata

I get an import error:
ImportError('No module named atom')

The problem is line 27 of the gdata package's __init__ file:
import atom

What I don't understand is that even if I explicitly add the package's
directory to sys.path, I still encounter the error.  For example, this
is ok:
sys.path.append('<BASEPATH>/vendor')
import google

But the following will raise the error:
sys.path.append('<BASEPATH>/vendor/google')
import atom  # or: import gdata

I've exhausted all my avenues.  What am I missing?  Help appreciated,
Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff S  
View profile  
 More options Feb 4 2010, 1:53 pm
From: Jeff S <j...@google.com>
Date: Thu, 4 Feb 2010 10:53:53 -0800 (PST)
Local: Thurs, Feb 4 2010 1:53 pm
Subject: Re: Importing Gdata Lib in Google App Engine
Hi Tom,

I think sys.path.append should be a viable option, what are you using
for the string? If you placed the gdata and atom directories under
vendor/google in your project, then you should be able to add this to
the path like this:

sys.path.append('vendor/google')

The above would work assuming that your directory structure is like
this

|-- app.yaml
...
|-- vendor
|   |-- google
|   |   |-- gdata
|   |   |   |-- __init__.py
...
|   |   |-- atom
|   |   |   |-- __init__.py

Hope this helps,

Jeff

On Jan 30, 12:36 pm, klenwell <klenw...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
klenwell  
View profile  
 More options Feb 7 2010, 1:32 pm
From: klenwell <klenw...@gmail.com>
Date: Sun, 7 Feb 2010 10:32:36 -0800 (PST)
Local: Sun, Feb 7 2010 1:32 pm
Subject: Re: Importing Gdata Lib in Google App Engine
Thanks for the response.  Strangely, this does not work for me.  I
tested this structure:

|-- app.yaml
...
|-- vendor
|   |-- google
|   |   |-- gdata
|   |   |   |-- __init__.py
...
|   |   |-- atom
|   |   |   |-- __init__.py
...
|   |   |-- mock_gdata
|   |   |   |-- __init__.py

In my code, I append vendor/google to sys and later include these
lines:

    import mock_gdata
    import gdata

mock_gdata contains only an __init__.py file and appears to be
successfully imported.  But gdata raises an exception.  This is the
traceback:

'error': ImportError('No module named gdata',),
'traceback': [('/home/klenwell/projects/appswell/appspot/appswell/
dispatch.py',
                70,
                '_process',
                'self._call_action(self.Controller_)'),
               ('/home/klenwell/projects/appswell/appspot/appswell/
dispatch.py',
                187,
                '_call_action',
                'return method_()'),
               ('/home/klenwell/projects/appswell/appspot/appswell/
controllers/demo_controller.py',
                306,
                'test_import',
                'import gdata')]}

If I put gdata and atom in app's root directory (parallel to
app.yaml), they are imported without incident.

Is there a rational explanation for this?  Could it have something to
do with the fact that the __init__.py files in gdata and atom aren't
empty?

Tom

On Feb 4, 10:53 am, Jeff S <j...@google.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mjbruder  
View profile  
 More options Feb 22 2010, 9:14 am
From: mjbruder <mjbru...@gmail.com>
Date: Mon, 22 Feb 2010 06:14:19 -0800 (PST)
Local: Mon, Feb 22 2010 9:14 am
Subject: Re: Importing Gdata Lib in Google App Engine
This might help (from http://code.google.com/appengine/articles/gdata.html):

"Using the gdata-python-client library

Google offers a Google Data Python client library that simplifies
token management and requesting data from specific Google Data APIs.
We recently released a version of this library that supports making
requests from Google App Engine applications. In this article we'll
use this library, but of course you're welcome to use whatever works
best for your application. Download the gdata-python-client library.

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!"

On Feb 7, 12:32 pm, klenwell <klenw...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mjbruder  
View profile  
 More options Feb 22 2010, 9:31 am
From: mjbruder <mjbru...@gmail.com>
Date: Mon, 22 Feb 2010 06:31:07 -0800 (PST)
Local: Mon, Feb 22 2010 9:31 am
Subject: Re: Importing Gdata Lib in Google App Engine
Looks to me like the gdata and atom directories need to go directly
into the root of your app. Then you will be able to use import
statements like 'import gdata.docs.service' or whatever you need from
there.

On Feb 7, 12:32 pm, klenwell <klenw...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »