-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"The version of Python associated with the selected kernel is no longer supported." #22877
Comments
I see this in my logs:
Notice the "3.1.0". This is weird, because my Conda environment runs version 3.12. I also completely reinstalled Miniconda and setup multiple environments using Python 3.10, 3.11 and 3.12 and all give the same error. |
And now I also completely removed and reinstalled VS Code and the issue persists. This only started occurring suddenly today, so maybe it has to do with an upgrade of the extension or of VS Code...? |
Suffering from the same problem. It also appears to result in the kernel crashing after a while with miniconda, whereas with venv environments everything is OK. |
I had the same issue. I rolled back to the previous jupyter extension version in VSCode (v2024.1.0), and that solved the problem for me for now. |
For folks running into the issue, can you please provide the debug logs?
Output for
|
I had the same issue and also rolled-back to the previous extension version of jupyter Notebook in Visual Studio Code v2024.1.2024012502 (pre-release) that worked for me too. |
@OrhanGuen @MarkSomogyvari Please do share the logs requested here if you run into this again #22877 (comment) |
I have same issues too. For python's version issue, I removed the file python31 in my env folder. Now everything is working fine, but the message "Python version associated with the selected kernel is no longer supported" still appears. |
@kksoo1769 please can you share the logs as requested in the previous post |
@DonJayamanne Here are the logs you requested. |
@kksoo1769 please share the logs as per instructions here |
Sorry, I have been on holidays, so no time to report back. I've just started VS Code again and my plugins got updated to:
Now the issue doesn't occur for me anymore... |
I changed it back to the current version of Jupyter v2024.1.1. Now there is no error anymore. |
Yes, I suspect this is an issue with the cache. @karrtikr is there something else users can to do get better logs and replicate this issue, e.g. clera the cache or re-create a new environment? Please advice, as we have a few uesrs running into this and @luabud too ran into this. |
I guess it is a bug when comparing python version string in extension v2024.1.1. Or does it just get the first digit after dot as version? It disappeared after rolling back to v2024.1.0. |
Agree with @ProcedureOriented .This bug vanishes after rolling back to v2024.1.0 |
@ProcedureOriented @king159 once again than you for getting back without the necessary information, really helps get to the bottom of this |
@DonJayamanne Then I tried to quit VS Code after installing each version of Jupyter extension, now I am sure it is a problem only on v2024.1.1, even I installed the version again. What's more, I found it has another indicator on this problem, on v2024.1.1, python 3.12 version will not show in the bracket after the environment's name, like this while the v2024.1.0 shows correctly: Actually, it seems like an occasional problem. When I stay in v2024.1.1, it shows 2 times in I tried 10 times restarting VS Code... I don't know what makes it perform like this. The output log after changing kernel from 'base' to 'py312' by clicking is here, FYI.
|
Hi all, can anyone please provide the complete Python logs as requested here: #22877 (comment). Current info:
|
Sorry, it was a different machine and I was doing some other work when I ran into this. |
@karrtikr And then I installed the latest pre-release Python extension, the problem solved when editing .py files, but the notification still pop up when open jupyter notebook files. However I could not find the same string in the log whatever actions I try. I noticed the Jupyter log contains
I don't know why "3.1.0" appears, so I attach the jupyter log if it helps. More, I found the kernel display in notebook seems different from the release version Python before. but they shows correctly in the list chose by: "Select Another Kernel..." > "Python Environments ...", and if I choose 'py312' again, the kernel shows version number in change list. But the notification still pops up when I switch to it from other kernel. I also found if I restart VS Code once or twice without running |
Thanks for the info @ProcedureOriented. Based on the logs Python extension seems to resolve the version correctly as "3.12.1", when using
@DonJayamanne In the logs pointed out containing "3.1.0", could it be the case that Jupyter is not using the results from "resolveEnvironment" API to get this version? As results from API seem to be correct based on the logs. |
FWIW Python extension might be returning "3.1.0" version via |
It also might be the case that Jupyter has its own cache containing "3.1.0" which isn't cleared? |
If the details are available in Also, the versions are not cached, version information is always retrieved from API, |
|
I do not think I can use Thanks, I'd rather wait for the fix, rather than patching our code as work around (that just adds more debt, as it is, we have a few layers from the old Pthon API types that we're still trying to get rid of) |
I am not sure of what exactly causes us to return "3.1.0" in the first place, we approximately figure out version based on nearby files, Consumer should be await on |
Isn't this a regression? this used to work? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@ProcedureOriented Can you please install the latest pre-release and provide me with the Python debug level logs after running |
@karrtikr |
@ProcedureOriented Great, it seems that this portion is returning the version as "{"major":3,"minor":1,"micro":-1}" when vscode-python/src/client/pythonEnvironments/common/commonUtils.ts Lines 218 to 233 in d0a07de
Can you provide the contents of "/opt/homebrew/Caskroom/miniforge/base/envs/py312/bin" directory? We're primarily interested in all the python binaries present inside the directory, based on whose filenames, we figure an approximate version. |
Yep, "python3.1" is an incorrect naming for that alias which is causing the bug. The tool which created the alias likely didn't account for multidigit minor versions, which is leading to the bug. I advise to either change the name or file an issue on miniforge. This is why version can only be best effort guess and not always reliable cc/ @DonJayamanne Closing this as cause for the bug lies somewhere else, thanks for all the help @ProcedureOriented . |
Failing tests are not related to the PR, so this is ready for review. For #22877
Applies To
What happened?
When I open a Notebook VS Code displays a message in the bottom right corner saying:
"The version of Python associated with the selected kernel is no longer supported. Please consider selecting a different kernel."
I'm using a Miniconda environment running Python 3.12.1.
VS Code Version
Version: 1.86.0 (Universal) Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937 Date: 2024-01-31T10:29:15.765Z Electron: 27.2.3 ElectronBuildId: 26495564 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.2.0
Jupyter Extension Version
v2024.1.0
Jupyter logs
No response
Coding Language and Runtime Version
Python 3.12.1
Language Extension Version (if applicable)
v2024.0.1
Anaconda Version (if applicable)
Conda 23.11..0 (Miniconda)
Running Jupyter locally or remotely?
Local
The text was updated successfully, but these errors were encountered: