Failing to install pyautogui on windows in vscode

Question:

I don’t know what is wrong with my PC. When I run python in IDLE, I am able to access it, however, when I move to vs-code, all hell breaks loose.

This is the error I am getting when I try to install it

File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0libdistutilsfile_util.py", line 236, in write_file
          f.write(line + "n")
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0libencodingscp1252.py", line 19, in encode
          return codecs.charmap_encode(input,self.errors,encoding_table)[0]
      UnicodeEncodeError: 'charmap' codec can't encode characters in position 22-23: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> PyTweening

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.```
Asked By: Raffle.ski

||

Answers:

I cleaned my system, literally. I wiped everything, fortunately I had my data backed etc. It appears that I there were conflicts with locally installed dependences. Now I advocate the use of venv to avoid this.

Answered By: Raffle.ski