Vinay Joseph
Vinay Joseph

Reputation: 5655

Can't import appengine python module

On my local machine I am unable to import appengine.ext module.

I have set the path using the following code

>>> import sys
>>> sys.path.insert(1, '/usr/local/google_appengine')
>>> sys.path.insert(1, '/usr/local/google_appengine/lib/yaml/lib')

Here is the error

Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.insert(1, '/usr/local/google_appengine')
>>> sys.path.insert(1, '/usr/local/google_appengine/lib/yaml/lib')
>>> from google import appengine
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name appengine
>>> from google.appengine.ext import ndb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named appengine.ext
>>> 

Upvotes: 0

Views: 418

Answers (1)

Rotem Vil
Rotem Vil

Reputation: 224

you should try to add the following code to the begining:

import dev_appserver
dev_appserver.fix_sys_path()

should work :).

Upvotes: 1

Related Questions