0

Please note that -

UnicodeDecodeError: 'charmap' codec can't decode byte X in position Y: character maps to <undefined>

Is a different problem as I'm not trying to manipulate a text file, but the "file" is probably the script itself.

I have been working on a pytorch project (using venv in pycharm), and all was running well until I decided to change a "hard coded" variable to an input argument to my script, using sys.argv, i.e.

import sys

Then in 'main' -

sample_window = sys.argv[1] ...

I tried to run the script from the console. The script ran once, but now it cannot run again with the pycharm debugger, as it causes some encoding error -

Fatal Python error: initsite: Failed to import the site module UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 516: character maps to

Even though no text has been changed in the script. I even tried to erase the sys related commands and return it to be "hard coded" but the problem persists.

I also cannot run it from terminal - same problem happens.

0 Answers0