I’m trying to install the latest version of Python on Windows 11, but I run into an error that won’t let it launch at all.
For context, I use Python with Anaconda and Spyder. The last time I have programmed in Python was two years ago, so all of my programs were pretty outdated. I uninstalled the old programs from my system first, and then downloaded newest versions of all of them. This was when I realized Anaconda and Spyder won’t launch at all, and would not even give an error message.
After this I tried running python from the windows command line and saw two important error messages:
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
ModuleNotFoundError: No module named ‘encodings’
I’ve tried looking up these error messages but I can’t find a solution that actually works for me. I’ve already uninstalled and reinstalled multiple times, and making sure to select “Add Python to PATH” when I do install it. When I look up these errors I see people working in much different environments than me, e.g. Linux or an IDE, but I can’t even launch my IDEs in the first place since Python won’t run.
Any help would be greatly appreciated- like I mentioned it’s been two years since I last programmed in Python so this is not my forte at all!!
C:\Windows\System32>py
Python path configuration:
PYTHONHOME = 'C:\edb\languagepack\v2\Python-3.9'
PYTHONPATH = (not set)
program name = 'C:\Program Files\Python312\python.exe'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = 'C:\edb\languagepack\v2\Python-3.9\Lib'
sys._base_executable = 'C:\\Program Files\\Python312\\python.exe'
sys.base_prefix = 'C:\\edb\\languagepack\\v2\\Python-3.9'
sys.base_exec_prefix = 'C:\\edb\\languagepack\\v2\\Python-3.9'
sys.platlibdir = 'DLLs'
sys.executable = 'C:\\Program Files\\Python312\\python.exe'
sys.prefix = 'C:\\edb\\languagepack\\v2\\Python-3.9'
sys.exec_prefix = 'C:\\edb\\languagepack\\v2\\Python-3.9'
sys.path = [
'C:\\Program Files\\Python312\\python312.zip',
'C:\\edb\\languagepack\\v2\\Python-3.9\\DLLs',
'C:\\edb\\languagepack\\v2\\Python-3.9\\Lib',
'C:\\Program Files\\Python312',
]
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 0x000035cc (most recent call first):
<no Python frame>
C:\Windows\System32>