0

Something was wrong with my Python installation so I tried to fix it by uninstalling and reinstalling Python. I've tried to do so several times, but whenever I type "python" into my terminal, I get this nasty error:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = 'C:\Users\jeffrey\AppData\Local\Programs\Python\Python39\'
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'C:\\msys64\\mingw64\\bin\\python.exe'
  sys.base_prefix = 'D:\\a\\msys64\\mingw64'
  sys.base_exec_prefix = 'D:\\a\\msys64\\mingw64'
  sys.platlibdir = 'lib'
  sys.executable = 'C:\\msys64\\mingw64\\bin\\python.exe'
  sys.prefix = 'D:\\a\\msys64\\mingw64'
  sys.exec_prefix = 'D:\\a\\msys64\\mingw64'
  sys.path = [
    'C:\\Users\\jeffrey\\AppData\\Local\\Programs\\Python\\Python39\\',
    'D:\\a\\msys64\\mingw64\\lib\\python310.zip',
    'D:\\a\\msys64\\mingw64\\lib\\python3.10',
    'D:\\a\\msys64\\mingw64\\lib\\lib-dynload',
    '',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00006b50 (most recent call first):
  <no Python frame>

Is there a way to uninstall everything and get a fresh Python installation? I'm on Windows.

I've tried uninstalling Python using the control panel, manually deleting the files myself, and I've removed Python from the PATH each time.

  • You have a mix of Python 3.9 and Python 3.10 in your path, and you're getting some files from "c:\msys64" and "d:\a\msys64". That's disastrous. You may need to uninstall BOTH of those, then reboot and try again. And delete the "python39" entry from your path. – Tim Roberts Jan 08 '23 at 05:14

0 Answers0