Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Non-UTF-8 code starting with '\x90' in file flask.exe #2543

Closed
whg517 opened this issue Dec 6, 2017 · 4 comments
Closed

SyntaxError: Non-UTF-8 code starting with '\x90' in file flask.exe #2543

whg517 opened this issue Dec 6, 2017 · 4 comments

Comments

@whg517
Copy link

whg517 commented Dec 6, 2017

Expected Behavior

In flask website use tutorials, in the third step flask run to run my web, appear this mistake.
In py files line first, I use the # - coding: utf-8 -- specified utf-8.
I'm writing code in Pycharm. Start the web with the CMD run command.
I copy the project directory into ubuntu and it works.
No related problems were found on the Internet.
Please give us some ideas and solve this problem.
thank you

Below is a screenshot of the Pycharm

Tell us what should happen.

kevin@DESKTOP-5KM5T43:~/workspaces/flaskr$ flask run
 * Serving Flask app "flaskr"
 * Forcing debug mode on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 244-441-781

Actual Behavior

Tell us what happens instead.

D:\workspace\development\python\WebProject\flaskr>flask run
 * Serving Flask app "flaskr"
 * Forcing debug mode on
 * Restarting with stat
  File "D:\ProgramData\Anaconda3\Scripts\flask.exe", line 1
SyntaxError: Non-UTF-8 code starting with '\x90' in file D:\ProgramData\Anaconda3\Scripts\flask.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Environment

  • Operating system
OS name: Microsoft Windows 10 professional edition
OS version: 10.0.16299 temporary lack of Build 16299
  • Python version:
D:\workspace\development\python\WebProject\flaskr>python --version
Python 3.6.3 :: Anaconda, Inc.
  • Flask version:
D:\workspace\development\python\WebProject\flaskr>python -m flask --version
Flask 0.12.2
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
  • Werkzeug version:
Werkzeug (0.12.2)
@greyli
Copy link
Member

greyli commented Dec 8, 2017

Duplicate of pallets/werkzeug#1136.

@greyli
Copy link
Member

greyli commented Dec 8, 2017

Currently you can use python -m flask run, until the bug was fixed.

@davidism davidism closed this as completed Dec 8, 2017
@whg517
Copy link
Author

whg517 commented Dec 8, 2017

@greyli Thank you very much. its working

@1992Zz
Copy link

1992Zz commented Jan 16, 2019

Currently you can use python -m flask run, until the bug was fixed.

Could you tell me more about it?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants