Import Failed When The Module Is Already In The Sys.path
Solution 1:
Can you import google
and google.appengine
?
Are you sure interpreter has read and traverse access rights to the module tree?
Solution 2:
I had the same problem on Ubuntu when I wanted to play with google.appengine in console. First I tried to fix it by removing the /usr/lib/python2.7/dist-packages/google
package altogether but Ubuntu One complained. Finally I resolved it by merging the GAE SDK google package into the package that caused the collision.
The contents of the /usr/lib/python2.7/dist-packages/google
dir now look like this:
/google
/appengine
/net
/protobuf
/pyglib
/storage
/__init__.py
/__init__.pyc
Solution 3:
Looks like you're getting a module (or package) called 'google' from elsewhere -- perhaps /home/tower/googlecode/mygae
-- and THAT google module has no appengine
in it. To check, print google.__file__
and if possible google.__path__
; that should be informative.
Solution 4:
Sometimes you can get an import error for a module when the error is something different, like a syntax error. Try putting
import pdb;pdb.set_trace()
just before the import and then s(tep) into the import, and n(ext) thruogh the module in question to see of you get an error.
Post a Comment for "Import Failed When The Module Is Already In The Sys.path"