I've managed to resolve this by moving all my sub folders and their files out of the src directory and into the main application dir. I then changed my PYTHONPATH to point directly to /appname; my previous PYTHONPATH was /appname/src. It might explain this issue if the GoogleAppEngineLauncher and Google App Engine servers have their PYTHONPATH set to /appname, since the project was running fine when I would debug from within the Eclipse environment where I'm able to control the PYTHONPATH.
On Jun 3, 10:35 pm, kaliopi <[email protected]> wrote: > well i've been intermittently been working with python for over a > year, and am pretty comfortable with the language. you are right in > that developers transitioning from typical language do like to keep > class files separate - and this includes me. my __init__.py files are > empty and my from/import statements are correct - the Eclipse > environment does not complain and when I debug from within Eclipse I > have no issues. The issue is when I add an Application configuration > to the Google Application Launcher Utility. When I browse the > application, it cannot find the class files I try importing. I'm just > wondering if this is an environment issue. It's really puzzling me at > the moment and do hope someone can help. > > Cheers > > On Jun 3, 5:39 pm, hawkett <[email protected]> wrote: > > > > > I'm guessing its the blank __init__.py - if you are coming to python > > from another language (everyone I've encountered runs into this issue) > > then it is petty non-obvious. Once you work out what's going on it > > makes lots of sense :) - @kaliopi - the __init__.py is a bunch of code > > that is run when the module is imported - so in many situations you > > may be able to define everything you need in __init__.py, and have it > > run simply as a result of 'import my_package' - however if you want to > > do it as separate files, then you still need a blank __init__.py or > > python won't recognise the directory as a module. > > > On Jun 3, 9:45 pm, Robert Kluin <[email protected]> wrote: > > > > Hi, > > > I am sure this is just a typo, but you say there error is > > > "ImportError: No module named model.y" but in your post you list the > > > name as "models." Also, I assume that you have a blank "__init__.py" > > > file in the models directory? > > > > Robert > > > > On Thu, Jun 3, 2010 at 3:40 PM, kaliopi <[email protected]> wrote: > > > > Eclipse does not take issue with anything being wrong the way I import > > > > my class files e.g. from x import y. > > > > Also when I debug the project in Eclipse as Google App Engine, > > > > everything works great. However when I run the project through Google > > > > App Engine Launcher (Mac osx) or when I upload my project to Google, I > > > > receive the error: ImportError: No module named model.y > > > > > Am I missing something? > > > > > Thanks > > > > > On Jun 3, 2:20 pm, Robert Kluin <[email protected]> wrote: > > > >> Peter, > > > >> What is the actual problem you are having? > > > > >> Have you tried using "from models import xxxx"? > > > > >> Robert > > > > >> On Wed, Jun 2, 2010 at 11:25 PM, kaliopi <[email protected]> > > > >> wrote: > > > >> > Hello, I'm trying to create directories that are practical to a > > > >> > python > > > >> > google app engine project structure. > > > > >> > For instance the directory structure I'm trying to implement is as > > > >> > follows: > > > > >> > src > > > >> > | > > > >> > ---->includes > > > >> > | > > > >> > ---->stylesheets > > > >> > | > > > >> > ---->js > > > >> > | > > > >> > ---->images > > > >> > | > > > >> > ---->views - html and codebehind files > > > >> > | > > > >> > ---->models - class files > > > > >> > inclusive in my app.yaml file includes and all dir beneath it as well > > > >> > as my views directories are properly consumed by the app engine and > > > >> > all files are served. However, I'm having issues with the app engine > > > >> > recognizing my models directory where I import subsequent modules/ > > > >> > classes into my codebehind files. > > > > >> > I've tried searching the group but wasn't really able to find any > > > >> > solution on how I can implement a directory strictly for python class > > > >> > files. > > > > >> > Can anyone tell me or point me to info where I can resolve this > > > >> > issue? > > > > >> > Thanks in advance. > > > > >> > -- > > > >> > 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 > > > >> > athttp://groups.google.com/group/google-appengine?hl=en. > > > > > -- > > > > 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 > > > > athttp://groups.google.com/group/google-appengine?hl=en. -- 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.
