pythonvisual-studio-codejupyter-notebookoserror

Jupyter Notebook (ipynb) in Visual Studio Code not running due to "OS Error: [WinError 1392]"


I restarted my computer, opened an ipynb file I had and tried to run the first cell. This is all to say, I didn't change anything fundamental in the code.

The first cell is just imports (import gym, import matplotlib etc.) but this cell gives the following error:

OSError: [WinError 1392] The file or directory is corrupted and unreadable: 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\http'.

I tried to select a different interpreter in VS Code but it didn't help (I tried a different version of Python, but maybe there's some issue with it because I have downloaded/deleted many versions of Python so I wouldn't be surprised if there was something missing).

How can I fix this error and get my notebook running?

Thank you very much!

EDIT: Do I just need to re-install Python?


Solution

  • Yes, completely deleting Python (by uninstalling from programs and removing from PATH, as described here) and then re-installing it fixed my issue.