0

When i am trying to follow the on-line python course to implement demo project,i got problems in importing errors.so,here is what i have done I use Google App Engine to run the server,and my python version is 2.7. here is my server dir

D:\PJ\Udacity\Python\engineapp

my program is edited in main.py in this dir,then,i try to do this in the file:

import os   import webapp2   import jinja2

when i build this file,error occurs

Traceback (most recent call last): File "D:\PJ\Udacity\Python\engineapp\main.py", line 18, in import webapp2 ImportError: No module named webapp2

I haved set the python path as someone said before How to add to the pythonpath in windows 7?

PYTHONPATH

D:\Python27;

  D:\Program Files (x86)\Google\google_appengine;

  D:\Program Files (x86)\Google\google_appengine\lib;

but,after doing this,i still got the import error. If anyone had solved related problem,please tell,i really appreciate you help.

Community
  • 1
  • 1

1 Answers1

0

The webapp2 you are trying to use will be deployed on the google cloud, having it in the local environment is fair enough only upto the point of testing it.

webapp2 also is there in a form of a library which is available in python app engine without having to put it in the lib folder.

You might want to read up this

modify your app.yaml file and add the following in the libraries section if there is one or just add it whole -

libraries:
- name: webapp2
  version: latest

if this still doesn't solve your problem you might want to read up an issue raised earlier this month - [Here]. As mentioned If your SDK version is 1.9.37 or 1.9.38 downgrade to 1.9.36 until a fix is released soon.(https://stackoverflow.com/a/37764786/4495081) and use a previous sdk build as mentioned

Community
  • 1
  • 1
minocha
  • 1,043
  • 1
  • 12
  • 26