Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Google App Engine ImportError: No module named msvcrt #594
Because Click was added to Flask 0.11 for the New Command Line Interface, and Click imports the Windows only module msvcrt, and the Google App Engine local development server doesn't contain this module, an import error is thrown.
I've created a workaround for the gae-init project (by modifying the App Engine config file), but it would be best to have a fix come directly from Flask/Click since there are likely many more people who will experience this issue when using Flask 0.11 with Google App Engine.
This was referenced
Jun 9, 2016
added a commit
Sep 10, 2016
I am facing same issue, it's annoying . I'm new to Flask on App Engine.
First dev_appserver.py app.yaml command was not running, it opens dev_appserver.py source code in editor. -> I changed associate file for .py to default python.exe, now working, but to open source code of .py file, now I have to right click and open with any editor (annoying).
Secondly it gives error dev_appserver: too few argumunets -> added /* in registry setting (No idea what it does). working now.
Now this Click thing. -.> installed Click 5.1 using pip, still issue is there.
import os import sys if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'): sys.path.insert(0, 'lib.zip') else: if os.name == 'nt': os.name = None sys.platform = '' import re # from google.appengine.tools.devappserver2.python import stubs from google.appengine.tools.devappserver2.python.runtime import stubs re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '') re_ = re.compile(re_) stubs.FakeFile._skip_files = re_ sys.path.insert(0, 'lib') sys.path.insert(0, 'libx') def webapp_add_wsgi_middleware(app): from google.appengine.ext.appstats import recording app = recording.appstats_wsgi_middleware(app) return app