kbth
kbth

Reputation: 1225

ImportError: No module named *

I want to create a web site on GAE.

I have an error importing module. Is something wrong in my code and structure?

ImportError: No module named appsite
INFO 2013-11-23 08:28:29,267 module.py:617] default: "GET / HTTP/1.1" 500 -

appname
|-app.yaml
|-index.yaml
|-favicon.ico
 |- appsite/
   |-public.py

app.yaml

handlers:- url: .*
script: appsite.public.app  
libraries:  
- name: webapp2  
version: "2.5.2"

public.py

app = webapp2.WSGIApplication([('/', MainHandler)], debug=True)

Upvotes: 0

Views: 1967

Answers (1)

Nijin Narayanan
Nijin Narayanan

Reputation: 2279

You must add __init__.py file under appsite directory.

The __init__.py files are required to make Python treat the directories as containing packages;

For more info: What is __init__.py for?

Upvotes: 1

Related Questions