0

Error image when I open up pip.exe

Fatal python error: Py_Initialize: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000262c (most recent call first): Then it crashes.

I have windows 7, no virtual environment (this is a problem with global install)

Edit: I fixed it by purging all of python on my computer. I uninstalled and deleted everything related to python, pip, jupyter, vscode python extention, pylint, and also removing all python related things on environment variables, then reinstalled everything and it works now. I think a problem I had was that my environment variables who were all over the place, it was the tech equivalent of something holding together with silver tape.

katten elvis
  • 1
  • 1
  • 1
  • Does this answer your question? [ImportError: No module named 'encodings'](https://stackoverflow.com/questions/38132755/importerror-no-module-named-encodings) – half of a glazier Mar 24 '21 at 12:22
  • When I copy and paste `Fatal python error: Py_Initialize: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'` [into a search engine](https://duckduckgo.com/?q=Fatal+python+error%3A+Py_Initialize%3A+unable+to+load+the+file+system+codec+ModuleNotFoundError%3A+No+module+named+%27encodings%27), I get [this](https://stackoverflow.com/questions/5694706/py-initialize-fails-unable-to-load-the-file-system-codec) as the first result. Does it help? – Karl Knechtel Mar 24 '21 at 12:22
  • It turns out I didn't have any PYTHONHOME or PYTHONPATH set so I added those environmental variables and got a new error: Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File "C:\Users\Emil\AppData\Local\Programs\Python\Python37\lib\_bootlocale.py", line 12, in getpreferredencoding if sys.flags.utf8_mode: AttributeError: 'sys.flags' object has no attribute 'utf8_mode' – katten elvis Mar 26 '21 at 09:19

0 Answers0