ImportError: No module named msvcrt.
In which file did you encounter the issue?
..../App-engine/standard/flask/tutorial/lib/click/__winconsole.py
Did you change the file? If so, how?
The lib folder and the click folder which contained this file was generated when I did "pip install -t lib -r requirements.txt " on the command prompt requirements.txt just contained one line that said Flask==0.12.2
These were the instructions
Describe the issue
I don't get any errors when I start the development server, it is only when I try to access localhost:8080 from my browser that the error occurs
@andrewsg can you take a look here?
Hi @mikemahon107, what behavior do you see when you try to access localhost:8080 from your browser? Do you get a stack trace at any point that you can share with us?
Add this to appengine_config.py
import os import sys on_appengine = os.environ.get('SERVER_SOFTWARE','').startswith('Development')
if on_appengine and os.name == 'nt': sys.platform = "Not Windows"
This issue is present for a while now. Happens when you try to kickstart a new Python+Flask application in the local development server on windows. Some guys here already did some research:
- https://github.com/pallets/flask/issues/1901
- https://github.com/pallets/click/issues/594
I opened a ticket on App Engine's official issue tracker too: https://issuetracker.google.com/issues/72043776
The reason is that python's standard set of libraries is different on Windows and Linux. On Windows, the msvcrt module is present, and click is loading that module. App Engine's isolated environment strips some of the builtin modules too, leaving only the ones that are present on the Linux based cloud, that's why msvcrt seems to be missing.
Thanks for being persistent and bringing this to our attention! msvcrt will be in the whitelist in the SDK once the change makes it through our testing pipeline.
Issue addressed in comments above.
This solution did not work for Django 1.11 :(