I'm trying to run a python script that has a dependency on charset_normalizer. When I execute the script with the command:
python myscript.py
I get the following error:
SyntaxError: Non-ASCII character '\xd1' in file /usr/local/lib/python3.9/dist-packages/charset_normalizer/__init__.py on line 12, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
I am using Python3.9 on Debian, and I have the PYTHONUTF8 environment variable set to 1
I figured this out - somehow I managed to get Python 2.7 and 3.9 on my machine, and the plain 'python' command was invoking Python 2. By using the command 'python3 myscript.py' it is now working as expected