Skip to content

"The version of Python associated with the selected kernel is no longer supported." #22877

Closed

Description

@luukburger

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

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.

Screenshot 2024-02-07 at 13 38 23

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

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    on Feb 7, 2024
  2. luukburger commented on Feb 7, 2024

    @luukburger
    Author

    I see this in my logs:

    20:45:44.076 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd06aa9a930b94239702003b1d5483aca273205853dc0a175a13e8fde3b74aafeaf.~/miniconda3/envs/python311/python.~/miniconda3/envs/python311/python.-m#ipykernel_launcher (Python Path: ~/miniconda3/envs/python311/bin/python, Conda, python311, 3.1.0) for '~/Code/crypto-quotes/notebooks/2. Data analysis/Analyse crypto quotes.ipynb' (disableUI=true)

    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.

  3. luukburger commented on Feb 7, 2024

    @luukburger
    Author

    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...?

  4. luukburger commented on Feb 7, 2024

    @luukburger
    Author

    Hmm, you also see the version being interpreted incorrectly in the kernel selector. Notice the 3.1...

    Screenshot 2024-02-07 at 21 21 34
  5. changed the title [-]Message "Version of Python no longer supported"[/-] [+]"The version of Python associated with the selected kernel is no longer supported."[/+] on Feb 7, 2024
  6. DonJayamanne commented on Feb 8, 2024

    @DonJayamanne

    Transferring to Python extension repo as this version information is returned by Python extensxion.
    Kartik Raj (@karrtikr) A similar issue was reported by Luciana Abud (@luabud) , looks like the version information returned is incorrect at some stage.

  7. kjarus1 commented on Feb 10, 2024

    @kjarus1

    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.

  8. MarkSomogyvari commented on Feb 12, 2024

    @MarkSomogyvari

    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.

  9. karrtikr commented on Feb 12, 2024

    @karrtikr

    For folks running into the issue, can you please provide the debug logs?

    • Run Developer: Set log level command
    • Select Trace
    • Run Developer: Reload Window command
    • Provide the output:
    Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

    XXX
    

  10. 47 remaining items

  11. DonJayamanne commented on Feb 27, 2024

    @DonJayamanne
  12. karrtikr commented on Feb 27, 2024

    @karrtikr

    Bryan Chen (@ProcedureOriented) Can you please install the latest pre-release and provide me with the Python debug level logs after running Python: Clear cache command?

  13. ProcedureOriented commented on Feb 28, 2024

    @ProcedureOriented

    Kartik Raj (@karrtikr)
    Hi, here are Python and Jupyter logs, log level is Trace.
    Python: v2024.3.10581547 (pre-release)
    Jupyter: v2024.1.2024012502 (pre-release)

    Python.log
    1-Jupyter.log

  14. karrtikr commented on Feb 28, 2024

    @karrtikr

    Bryan Chen (@ProcedureOriented) Great, it seems that this portion is returning the version as "{"major":3,"minor":1,"micro":-1}" when "/opt/homebrew/Caskroom/miniforge/base/envs/py312/bin/python" is passed into it which is the cause.

    async function getPythonVersionFromNearByFiles(interpreterPath: string): Promise<PythonVersion> {
    const root = path.dirname(interpreterPath);
    let version = UNKNOWN_PYTHON_VERSION;
    for await (const entry of findInterpretersInDir(root)) {
    const { filename } = entry;
    try {
    const curVersion = parseVersion(path.basename(filename));
    if (comparePythonVersionSpecificity(curVersion, version) > 0) {
    version = curVersion;
    }
    } catch (ex) {
    // Ignore any parse errors
    }
    }
    return version;
    }

    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.

  15. ProcedureOriented commented on Feb 28, 2024

    @ProcedureOriented

    Kartik Raj (@karrtikr)
    Here it is. Btw I noticed there are alias named python, python3, and python3.1 in it. I guess whether the alias cause the bug.
    ls_la.txt

  16. karrtikr commented on Feb 28, 2024

    @karrtikr

    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/ Don Jayamanne (@DonJayamanne)

    Closing this as cause for the bug lies somewhere else, thanks for all the help Bryan Chen (@ProcedureOriented) .

  17. locked as resolved and limited conversation to collaborators on Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions