conan
conan copied to clipboard
[bug] conan-script.py fails because of unicode character in python shebang
In C:\Users\UserWithé\AppData\Local\Programs\Python\Python310\Scripts, conan-script.py seems to be missing a # -*- encoding: utf-8 -*- at the top of the file. The shebang that gives the path to the python interpreter looks like this #!C:\Users\UserWith�\AppData\Local\Programs\Python\Python310\python.exe.
Without it, I got a "SyntaxError: Non-UTF-8 code starting with '\x91'" error when running conan, because my username has an accent in it.
Environment Details (include every applicable attribute)
- Operating System+version: Windows Version 10.0.19044 Build 19044
- Compiler+version: MSVC 19.29.30145.0 Visual Studio 16 2019
- Conan version:1.50.0
- Python version: Python 3.10.5
Steps to reproduce (Include if Applicable)
conan
Logs (Executed commands with output) (Include/Attach if Applicable)
"failed to create process."
or SyntaxError: Non-UTF-8 code starting with '\x91'
Hi @Riuzakiii
Can you please detail your OS, OS version, process to install Conan, Python version, process to install Python?
What you are describing, the conan-script.py is not a file that we generate, this seems to be part of the Python pip installer, I am not sure it is something that we can fix, but it could be a pip bug.
The versions I'm using are in the "Environment details" of the description of the issue.
Process to install Python
- Download latest installer from https://www.python.org/downloads/windows/
- Add Python to the user path
Process to install Conan
python -m pip install conan
I realized my pip version was not the latest, so I upgraded pip with pip install --upgrade pip (upgraded to pip-22.2), did a fresh conan install, I still have the same issue

I can open a ticket on the pip repository (or https://github.com/pypa/setuptools maybe) if you don't think this can be solved here.
It seems this has already been reported, first in pip repo, then in setuptools in https://github.com/pypa/setuptools/issues/1246. Seems the default encoding could also be related.
Thanks for finding the related issues, I might create a new issue in pypa/setuptools to see if this can be fixed (the two issues date back to 2018)
Closing this as not an issue, it was apparently not a Conan issue.