spyder: `This version of python seems to be incorrectly compiled` message with Python 3.11 from Anaconda
- Console banner:
Python 3.11.2 | packaged by Anaconda, Inc. | (main, Mar 27 2023, 23:35:04) [MSC v.1916 64 bit (AMD64)]Type "copyright", "credits" or "license" for more information.IPython 8.10.0 -- An enhanced Interactive Python
- Message:
This version of python seems to be incorrectly compiled(internal generated filenames are not absolute).This may make the debugger miss breakpoints.Related bug: http://bugs.python.org/issue1666807.
For example restart the kernel to see it:
Restarting kernel..
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 21 (10 by maintainers)
I think that’s a good idea. Thanks for tracking the problem down and finding a solution @dalthviz! Please go ahead and implement it.
Since Guido himself proposed the same solution in the PyDev.Debugger repo, it doesn’t appear to be harmful. In addition, we don’t use nor depend on the PyDev debugger, so I’m not expecting major issues with this change.
Checked locally and was able to reproduce this 👍 Also, creating the env with packages from the conda-forge channel prevents this message 🤔
Checking a little bit more the Python issue linked in the message, seems like if you add to the command that Spyder uses to launch the console kernel a
-Xfrozen_modules=offflag the message stops. The change can be done at:https://github.com/spyder-ide/spyder/blob/00ebc4ad55b3c0437f9b096dccfb8dee65033a16/spyder/plugins/ipythonconsole/utils/kernelspec.py#L113-L119
So the code ends up being something like:
The comment that suggest the use of the
-Xfrozen_modules=offflag: https://bugs.python.org/issue1666807#msg416932There seems to be a newer Anaconda 2023-07-2 installer that is updated to Python 3.11.4 whereas the previous 2023-07-01 and 2023-07-0 used Python 3.11.3 as far as I can tell it has also resolved the issue despite it being the same version of Spyder 5.4.3:
https://docs.anaconda.com/free/anaconda/reference/release-notes/#anaconda-2023-07-2-august-04-2023
I opened Anaconda Prompt using “Run as Administrator” and then I ran this command:
conda update condaAnd it fixed this problem for me.
@Taha0229, @yanyu2015, this problem was fixed in our latest version (5.4.4), which is not available in Anaconda yet. In the meantime, you can safey ignore that message because it’s simply a warning and doesn’t affect Spyder in any way.