Question: How can I solve the no-ascii character error running pserve on virtualenv in windows?
Description: I am trying to execute pserve (pyllons / pyramid development web server) inside virtualenv on windows. This is a new installation, so it may be related to versions.
Problem: When virtualenv is activated, run pserve config.ini throw error: SyntaxError: Non-ASCII character '\x90' in file C:\PATH_TO_MY_ENV_HOME\env\Scripts\pserve.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details SyntaxError: Non-ASCII character '\x90' in file C:\PATH_TO_MY_ENV_HOME\env\Scripts\pserve.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details .
Command line:
pserve development.ini --reload
Notes:
- this error occurs when you have a character file that does not match the current encoding of the file, so you can add instructions to set the correct encoding on the threshold of a python script.
- this can happen if the called target has an exe extension in some cases and a script that causes it to add exe to the end. Thus, python runtime causes this error, so the exe file cannot be called as a script, but simply called without adding sufix.
- The path to the executable file does not contain special characters.
Tests completed:
- Remove the exe extension from pserve. Not working: command message not recognized.
- Call pserve- script.py instead of pserve (full path tried too). It did not work: to do nothing and returns nothing.
- Added "- * - encoding: utf-8" at the beginning of pserve- script.py. This is the same message.
- Delete exe extenstion from python.exe (tried the full path too). Did not work: "could not create the process."
Environment:
- Windows 10 1607 build 14393.447
- Python Version: Anaconda2, Python 2.7.11
- Version for the pyramid: pyramid 1.7.3
- Virtual env: 15.1.0
DECISION:
Removing and installing again solved the problem for me.
python windows pyramid virtualenv
Diogo paschoal
source share