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 <robert.kl...@gmail.com> 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 <peter.zor...@gmail.com> 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 <robert.kl...@gmail.com> 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 <peter.zor...@gmail.com> 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 google-appeng...@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > google-appengine+unsubscr...@googlegroups.com. > >> > 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 google-appeng...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-appengine+unsubscr...@googlegroups.com. > > 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 google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.