0

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
>>> 
4
  • no. its empty >>> print sys.path[0] >>> Commented Apr 28, 2016 at 9:35
  • I have a google folder in the virtual env /env/lib/python2.7/site-packages/google Commented Apr 28, 2016 at 9:38
  • Just tried it, and it did not work, I am getting the same issue Commented Apr 28, 2016 at 9:42
  • Let us continue this discussion in chat. Commented Apr 28, 2016 at 9:43

1 Answer 1

1

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

import dev_appserver
dev_appserver.fix_sys_path()

should work :).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.