I recently used windows' virtual environment to set up the environment in order to run PyTorch deep learning code.
Starting from the very simplistic code in PyTorch's official tutorial, I managed to run the code for the first time. However, after my first running and executing "python" in command line, it shows:
(venv) PS C:\Users\xxx\demo_pytorch\venv> python
Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
File "C:\Users\xxx\Miniconda3\lib\site.py", line 579, in <module>
main()
File "C:\Users\xxx\Miniconda3\lib\site.py", line 562, in main
known_paths = venv(known_paths)
File "C:\Users\xxx\Miniconda3\lib\site.py", line 494, in venv
addsitepackages(known_paths, [sys.prefix])
File "C:\Users\xxx\Miniconda3\lib\site.py", line 349, in addsitepackages
addsitedir(sitedir, known_paths)
File "C:\Users\xxx\Miniconda3\lib\site.py", line 207, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Users\xxx\Miniconda3\lib\site.py", line 163, in addpackage
for n, line in enumerate(f):
File "C:\Users\xxx\Miniconda3\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 654: character maps to <undefined>
Can anyone tell me how to fix this? The default python in the VS code has been set as .\Scripts\python.exe