Reputation: 119
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)\Google\google_appengine\lib\;C:\Python27\;C:\Python27\Scripts\;D:\Program Files (x86)\Google\google_appengine\
(System PATH)
C:\Python27\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\PROGRAM FILES (X86)\AMD APP\BIN\X86_64;C:\PROGRAM FILES (X86)\AMD APP\BIN\X86;C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT%\SYSTEM32\WBEM;%SYSTEMROOT%\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;D:\PROGRAM FILES\ATI TECHNOLOGIES\ATI.ACE\CORE-STATIC;C:\PROGRAM FILES (X86)\WINDOWS LIVE\SHARED;C:\PROGRAM FILES (X86)\COMMON FILES\INTUIT\QBPOSSDKRUNTIME;C:\PROGRAM FILES (X86)\GOOGLE\GOOGLE APPS SYNC\;C:\PROGRAM FILES (X86)\GOOGLE\GOOGLE APPS MIGRATION\;C:\PROGRAM FILES\COMMON FILES\NEATRECEIPTS\DRIVERS\M12\;D:\PROGRAM FILES (X86)\GOOGLE\GOOGLE_APPENGINE\;D:\PROGRAM FILES (X86)\GOOGLE\GOOGLE_APPENGINE\LIB\;;D:\PROGRAM FILES (X86)\QUICKTIME\QTSYSTEM\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
I created a PYTHONPATH variable:
D:\Program Files (x86)\Google\google_appengine\lib;
The error I get when running anything in Aptana or the command line:
Traceback (most recent call last): File "D:\Dropbox\Dropbox\Python Files\Udacity Python\Blog\Blog\main.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)\Google\google_appengine\dev_appserver .py" "D:\Dropbox\Dropbox\Python Files\Udacity Python\blog\blog\main.py" Traceback (most recent call last): File "D:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 1 97, in _run_file(file, globals()) File "D:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 1 93, in _run_file execfile(script_path, globals_) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de vappserver2\devappserver2.py", line 872, in main() File "D:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de vappserver2\devappserver2.py", line 865, in main dev_server.start(options) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de vappserver2\devappserver2.py", line 657, in start options.yaml_files) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de vappserver2\application_configuration.py", line 549, in init module_configuration = ModuleConfiguration(yaml_path) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de vappserver2\application_configuration.py", line 82, in init self._yaml_path) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de vappserver2\application_configuration.py", line 266, in _parse_configuration return appinfo_includes.ParseAndReturnIncludePaths(f) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\api\appi nfo_includes.py", line 63, in ParseAndReturnIncludePaths appyaml = appinfo.LoadSingleAppInfo(appinfo_file) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\api\appi nfo.py", line 1756, in LoadSingleAppInfo listener.Parse(app_info) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\api\yaml _listener.py", line 226, in Parse self._HandleEvents(self._GenerateEventParameters(stream, loader_class)) File "D:\Program Files (x86)\Google\google_appengine\google\appengine\api\yaml _listener.py", line 172, in _HandleEvents for event in events: File "D:\Program Files (x86)\Google\google_appengine\google\appengine\api\yaml _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:\Dropbox\Dropbox\Python Files\Udacity Python\blog\blog\main.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.applibraries: - name: webapp2
version: "2.5.2"
Upvotes: 0
Views: 622
Reputation: 119
This is definately a configuration issue. Multiple apps and overnight none of them work, some that haven't been touched in weeks. I'm going to z out the machine and try again. Thanks all.
Upvotes: 0
Reputation: 16826
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.
Upvotes: 1