Skip to content
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

VS Code failed to resovle the correct Python path #24624

Open
wyatt-wong opened this issue Dec 17, 2024 · 9 comments
Open

VS Code failed to resovle the correct Python path #24624

wyatt-wong opened this issue Dec 17, 2024 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@wyatt-wong
Copy link

Discussed in #24610

Originally posted by wyatt-wong December 16, 2024
I have installed the Python and Jupyter extensions from Microsoft, but everytime when I create a new Jupyter notebook or opened an existing Jupyter notebook, I found that VS Code was stuck in executing "Reactivating terminals" and it is finding the old version of Python 3.13.0 as follows:

[error] sendStartupTelemetry() failed. l [Error]: Failed to resolve env "/Users/wyattwong/.pyenv/versions/3.13.0/bin/python"

I checked the Default Interpreter Path is pointing to /Users/wyattwong/.pyenv/versions/venv/bin/python

Screenshot 2024-12-16 at 11 47 24 PM

I checked the /Users/wyattwong/.pyenv/versions/venv/bin/python is already pointing to the correct Python version 3.13.1.

Screenshot 2024-12-16 at 11 48 57 PM

How do I fix this issue ?

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 17, 2024
@karthiknadig karthiknadig self-assigned this Dec 17, 2024
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Dec 17, 2024
@karthiknadig
Copy link
Member

Can you run this command from a terminal and share the result?

/Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64/out/python-env-tools/bin/pet resolve /Users/wyattwong/.pyenv/versions/venv/bin/python

You can change the path to any broken python and share the result please:

/Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64/out/python-env-tools/bin/pet resolve <path-to-python-binary>

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 17, 2024
@wyatt-wong
Copy link
Author

wyatt-wong commented Dec 17, 2024

/Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64/out/python-env-tools/

I found there was no /Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64/out/python-env-tools/ path

Image

I have uninstall Python VS Code extension, then manually removed the /Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64 folder and re-install the Python VS Code extension but the result was the SAME.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Dec 17, 2024
@karthiknadig
Copy link
Member

Sorry, it might be in the parent of out:

/Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64/python-env-tools/bin/pet

@wyatt-wong
Copy link
Author

Sorry, it might be in the parent of out:

/Users/wyattwong/.vscode/extensions/ms-python.python-2024.22.0-darwin-x64/python-env-tools/bin/pet

Here is the result:

Image

@karthiknadig
Copy link
Member

And what do you get when you try to resolve this /Users/wyattwong/.pyenv/versions/3.13.0/bin/python

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 17, 2024
@wyatt-wong
Copy link
Author

I thought the problem maybe caused by the pyscript extension

https://marketplace.visualstudio.com/items?itemName=HardeepSingh.pyscript

Anyway, I have uninstall PyScript extension and manually remove the pyscript folder below.

/Users/wyattwong/.vscode/extensions/hardeepsingh.pyscript-0.1.1

Then after I re-installed pyscript extension and try create a new Jupyter notebook or open an existing Jupyter notebook, I no longer see the "Reactivating terminals" error.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Dec 17, 2024
@wyatt-wong
Copy link
Author

/Users/wyattwong/.pyenv/versions/3.13.0/bin/python

I got the following error:

Image

@karthiknadig
Copy link
Member

This looks like python environment tools is failing to detect pyenv versions that are no longer installed or removed. Just to confirm, would be possible to list the installed versions of python you have with pyenv?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 17, 2024
@wyatt-wong
Copy link
Author

wyatt-wong commented Dec 17, 2024

This looks like python environment tools is failing to detect pyenv versions that are no longer installed or removed. Just to confirm, would be possible to list the installed versions of python you have with pyenv?

Well maybe it should be the Python Environment Manager extension instead of PyScript extension is causing the problem:

https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager

Anyway, now when I create a New Jupyter notebook, I got the following output:

Image

Thanks for your assistance.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants