I actually think this may be related to the following issue:
http://code.google.com/p/googleappengine/issues/detail?id=772

Which is related to resetting of the sys.path variable (see Guido's
explanation in the issue).

Mostly, I don't think there is any reason to modify the sys.path in your
case.  You should just eliminate the 'external' directory and include the
modules directly under the application's root folder, and import the modules
as normal in Python.

-Marzia

On Mon, Nov 10, 2008 at 10:23 AM, Rodrigo Moraes
<[EMAIL PROTECTED]>wrote:

>
> On Mon, Nov 10, 2008 at 3:27 PM, Marzia Niccolai wrote:
> > Hi Rodrigo,
> >
> > Is this a standard Python module or your own code? If your own code, does
> > the folder in which the code resides contain an __init__.py file?  Could
> you
> > provide your directory structure and the exact module(s) name(s) that are
> > being effected?
>
> Hi Marzia,
> This happens from time to time with various modules I include in my
> app directory, and it is kinda random. They all have __init__.py. For
> example, I have this in my code:
>
> import simplejson.decoder
> json = simplejson.decoder.JSONDecoder()
>
> The simplejson module is located in a 'external' directory that i add
> to sys.path in main.py:
>
> # Add our own directory, so we can import from it.
> root = os.path.dirname(__file__)
> sys.path.insert(0, root)
> sys.path.append(os.path.join(root, 'external'))
>
> A couple of times I got a "No module named simplejson.decoder" error,
> and after restarting the server the error was gone and the module is
> loaded normally (without any modifications in the code).
>
> But this doesn't help only with modules. Some templates are not found
> despite they are in the right place, and after I restart the server
> they work as they should. I guess this is related to how the sdk
> caches its stuff.
>
> I am developing in Mac OSX 10.5.5
>
> thanks,
> -- rodrigo
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to