All of a sudden, Webapp2 can not be found by the python interpreter

I’m running the latest Python 2.7 and Google App Engine SDK on Windows. Everything is working fine until tonight, now python is throwing import errors about webapp2 in every app I have and all local projects are returning blank pages.

I’ve seen all the posts about the path, etc but its not working. I installed Bluestacks the other day and I think that POS did something. I’ve done several uninstall and reinstalls of everything python related to no avail.

Here is my path string if it helps

(User PATH)

D:Program Files  (x86)Googlegoogle_appenginelib;C:Python27;C:Python27Scripts;D:Program Files (x86)Googlegoogle_appengine

(System PATH)

C:Python27;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:PROGRAM FILES (X86)AMD APPBINX86_64;C:PROGRAM FILES (X86)AMD APPBINX86;C:PROGRAM FILESCOMMON FILESMICROSOFT SHAREDWINDOWS LIVE;C:PROGRAM FILES (X86)COMMON FILESMICROSOFT SHAREDWINDOWS LIVE;%SYSTEMROOT%SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT%SYSTEM32WBEM;%SYSTEMROOT%SYSTEM32WINDOWSPOWERSHELLV1.0;D:PROGRAM FILESATI TECHNOLOGIESATI.ACECORE-STATIC;C:PROGRAM FILES (X86)WINDOWS LIVESHARED;C:PROGRAM FILES (X86)COMMON FILESINTUITQBPOSSDKRUNTIME;C:PROGRAM FILES (X86)GOOGLEGOOGLE APPS SYNC;C:PROGRAM FILES (X86)GOOGLEGOOGLE APPS MIGRATION;C:PROGRAM FILESCOMMON FILESNEATRECEIPTSDRIVERSM12;D:PROGRAM FILES (X86)GOOGLEGOOGLE_APPENGINE;D:PROGRAM FILES (X86)GOOGLEGOOGLE_APPENGINELIB;;D:PROGRAM FILES (X86)QUICKTIMEQTSYSTEM;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelOpenCL SDK3.0binx86;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0

I created a PYTHONPATH variable:

D:Program Files (x86)Googlegoogle_appenginelib;

The error I get when running anything in Aptana or the command line:

Traceback (most recent call last): File "D:DropboxDropboxPython FilesUdacity PythonBlogBlogmain.py", line 17, in import webapp2 ImportError: No module named webapp2

Could there be Environmental variables GAE sets that I’m missing now? Please help, I’m at my wits end.

Thanks!

Update

In response to jacek2v, the output is

C:Python27>python “D:Program Files (x86)Googlegoogle_appenginedev_appserver .py” “D:DropboxDropboxPython FilesUdacity Pythonblogblogmain.py” Traceback (most recent call last): File “D:Program Files (x86)Googlegoogle_appenginedev_appserver.py”, line 1 97, in _run_file( file
, globals()) File “D:Program Files (x86)Googlegoogle_appenginedev_appserver.py”, line 1 93, in _run_file execfile(script_path, globals_) File “D:Program Files (x86)Googlegoogle_appenginegoogleappenginetoolsde vappserver2devappserver2.py”, line 872, in main() File “D:Program Files (x86)Googlegoogle_appenginegoogleappenginetoolsde vappserver2devappserver2.py”, line 865, in main dev_server.start(options) File “D:Program Files (x86)Googlegoogle_appenginegoogleappenginetoolsde vappserver2devappserver2.py”, line 657, in start options.yaml_files) File “D:Program Files (x86)Googlegoogle_appenginegoogleappenginetoolsde vappserver2application_configuration.py”, line 549, in init
module_configuration = ModuleConfiguration(yaml_path) File “D:Program Files (x86)Googlegoogle_appenginegoogleappenginetoolsde vappserver2application_configuration.py”, line 82, in init
self._yaml_path) File “D:Program Files (x86)Googlegoogle_appenginegoogleappenginetoolsde vappserver2application_configuration.py”, line 266, in _parse_configuration return appinfo_includes.ParseAndReturnIncludePaths(f) File “D:Program Files (x86)Googlegoogle_appenginegoogleappengineapiappi nfo_includes.py”, line 63, in ParseAndReturnIncludePaths appyaml = appinfo.LoadSingleAppInfo(appinfo_file) File “D:Program Files (x86)Googlegoogle_appenginegoogleappengineapiappi nfo.py”, line 1756, in LoadSingleAppInfo listener.Parse(app_info) File “D:Program Files (x86)Googlegoogle_appenginegoogleappengineapiyaml _listener.py”, line 226, in Parse self._HandleEvents(self._GenerateEventParameters(stream, loader_class)) File “D:Program Files (x86)Googlegoogle_appenginegoogleappengineapiyaml _listener.py”, line 172, in _HandleEvents for event in events: File “D:Program Files (x86)Googlegoogle_appenginegoogleappengineapiyaml _listener.py”, line 212, in _GenerateEventParameters raise yaml_errors.EventListenerYAMLError(e) google.appengine.api.yaml_errors.EventListenerYAMLError: mapping values are not allowed here in “D:DropboxDropboxPython FilesUdacity Pythonblogblogmain.py”, line 19 , column 42

This is a simple program that outputs one line. Here is the main.py file

import webapp2

class MainHandler(webapp2.RequestHandler): ***THIS is line 19, column 42 per the error above, I omitted the comments above it for clarity.

def get(self):
    self.response.write('Bloogggger')

app = webapp2.WSGIApplication([ (‘/’, MainHandler),(‘/’, Blog, ‘/’),(‘/blog/’, newpost ) ], debug=True)

Here is the app.yaml ***Its properly formatted and indented in the file, i can’t get it to paste properly here

application: wpablog2014 version: 1 runtime: python27 api_version: 1 threadsafe: yes

handlers: – url: /favicon.ico

static_files: favicon.ico

upload: favicon.ico

  • url: .*

    script: main.app

libraries: – name: webapp2

version: “2.5.2”

raise yaml_errors.EventListenerYAMLError(e)

Your problem is on the app.yaml
file:

Your mistake
is here, the syntax is wrong. the -
goes to next line indented by 2 spaces:

handlers: - url: /favicon.ico #wrong
static_files: favicon.ico #wrong
upload: favicon.ico #wrong

url: .*
script: main.app#wrong
libraries: - name: webapp2 #very wrong
version: "2.5.2" #wrong

correct example:

libraries:
- name: jinja2
  version: latest

- name: webapp2
  version: latest

The syntaxt in the app.yaml file is strict. Please read here
about it’s syntax and
here

for the app engine config.

Btw when having a problem try to read the logs for keywords. The log is your friend.

Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合编程 » All of a sudden, Webapp2 can not be found by the python interpreter

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录