Reputation: 369
So I have just installed python version 3.11 and changed my python interpreter in pycharm and the code runs properly now after I reinstalled the packages to my new venv.
but when i debug my code I keep getting a long list of warnings and I have no idea how to fix it:
-------------------------------------------------------------------------------
pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute)
pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints.
pydev debugger: Related bug: http://bugs.python.org/issue1666807
-------------------------------------------------------------------------------
Connected to pydev debugger (build 221.5080.212)
pydev debugger: Unable to find real location for: <frozen codecs>
pydev debugger: Unable to find real location for: <frozen importlib._bootstrap>
pydev debugger: Unable to find real location for: <frozen importlib._bootstrap_external>
pydev debugger: Unable to find real location for: <frozen zipimport>
pydev debugger: Unable to find real location for: <frozen ntpath>
pydev debugger: Unable to find real location for: <frozen genericpath>
pydev debugger: Unable to find real location for: <frozen os>
pydev debugger: Unable to find real location for: <frozen _collections_abc>
pydev debugger: Unable to find real location for: <string>
pydev debugger: Unable to find real location for: <frozen abc>
pydev debugger: Unable to find real location for: <__array_function__ internals>
pydev debugger: Unable to find real location for: <frozen io>
I installed it for all users to C:\Program Files if that helps
Upvotes: 13
Views: 10010
Reputation: 406
If you happen to have this error with fastApi you can start it with disabled reload and breakpoints will work again
uvicorn.run("bootstrap:app", host="0.0.0.0", port=8080, reload=False)
Updating pycharm or downgrading python to 3.10 also works
Upvotes: 2
Reputation: 953
Downgrading Python is also an option. This is especially easy and fast to test creating new Anaconda environment.
Had this error under 3.12, but not under 3.10 PyCharm interpreter.
Upvotes: 1
Reputation: 151
For me, this error came up simply for calling a function incorrectly. I had parameters that were referring to one another.
funct(my_array, my_array[0])
Upvotes: 0
Reputation: 8515
Should be fixed in PyCharm 2022.3 (ticket https://youtrack.jetbrains.com/issue/PY-56939/CRITICAL-WARNING-error-debugging-Python-311-code).
Early Access Preview version is already available https://www.jetbrains.com/pycharm/nextversion/
Upvotes: 13