Python 3.11 interperter crash on Windows 11

I installed Python 3.11 64-bit recommended version from installer page:

I ran the installer as admin, and set it to install Python for all users.

After installation any attempt to run Pyhon 3.11 crashes with this error:

"Exception ignored error evaluating path:
Traceback (most recent call last):
File “”, line 660, in
OSError: failed to make path absolute
Fatal Python error: error evaluating path
Python runtime state: core initialized

Current thread 0x000010a8 (most recent call first):

I tried running the following ways:

  1. In admin CMD session cd directly to Python interpertation installation in AppData\Local\Programs\Python\Python311 and run "python.exe -c “import sys; print(sys.executable)”
  2. In admin CMD session on "C:" drive just run “python”

I have Python311 set in PATH of both System and User
I have Python311 in Registry key Computer\HKEY_CURRENT_USER\Software\Python\PythonCore\3.11, but not in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore

What could be the reason the Python interperter crashes like this?

My Python 3.10 installation works just fine, no issues at all.

If you don’t have any python in PATH (neither user nor system, neither python3.10 nor python3.11) and use the py launcher instead, do you still have this issue?

I do not believe PATH is the issue, because when I cd directly to the folder of the Python 3.11 installation in AppData\Local\Programs\Python\Python311 and run ‘python.exe -c “import sys; print(sys.executable)”’ I get exactly same error

The problem is if there are multiple python versions on the path, there might be issues with which dlls get loaded. This isn’t exactly likely, but it is a factor you at the very least could eliminate quite easily.

Otherwise, the answer is “your current cwd is too long”, or “the windows C API doesn’t work correctly” from my reading of the relevant source code.

I see. Thanks for the explanation, I’ll try and keep just Python 3.11 in the PATH, like before installing I had just Python 3.10 which worked fine, and see if behaves well. If there are still issues I’ll try the setup you proposed with ‘py’ launcher without PATH.

Should I update something in the Windows C API for Python 3.11? Something the installer doesn’t do on its own?

No, nothing should need to be setup. You should probably also report this issue on the proper bug tracker, especially if having only one python in PATH doesn’t solve it.

1 Like