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

Extension forgets the Python interpreter for my workspace (pythonDeprecatePythonPath exp) #16599

Closed
david-waterworth opened this issue Jul 1, 2021 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@david-waterworth
Copy link

I restarted vscode today and my workspace python virtualenv changed from the virtual env I had selected in python.pythonPath to one from an unrelated project. This appears to be a consequence of the pythonDeprecatePythonPath experiment. It's not clear to me how this is supposed to work yet, but in any case I would have assumed that when it is first enabled the project interpreter shouldn't silently change from one virtualenv to another, it should migrate the previous settings and continue to use the correct virtualenv?

Environment data

  • VS Code version: 1.57.1
  • Extension version (available under the Extensions sidebar): 2021.6.944021595
  • OS and version: Ubuntu 20.04
  • Python version (& distribution if applicable, e.g. Anaconda): XXX
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv virtualenv

Expected behaviour

When restarting vscode, the project's virtualenv should not change

Actual behaviour

On restart, pythonDeprecatePythonPath changed my virtualenv to a different one, unrelated to the existing python.pythonPath

Steps to reproduce:

@david-waterworth david-waterworth added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Jul 1, 2021
@kimadeline kimadeline added info-needed Issue requires more information from poster triage and removed triage-needed Needs assignment to the proper sub-team labels Jul 5, 2021
@kimadeline
Copy link

Hi @david-waterworth, thank you for reaching out!

Could you provide the content of the Python output channel?

Thanks!

@david-waterworth
Copy link
Author

Hi @kimadeline

After opening a python folder for the first time after upgrading, this is the contents of Python

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'pythonSurveyNotification'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'pythonDeprecatePythonPath'
Python interpreter path: ~/.pyenv/versions/huggingface/bin/python
Python interpreter path: ~/.pyenv/versions/ontologies/bin/python
Starting Pylance language server.
> conda --version

Note, it seems to have found 2 paths but there's only one set in settings.json

{
    "python.pythonPath": "/home/david/.pyenv/versions/ontologies/bin/python"
}

and the one it picked was wrong (it took the first).

@karrtikr karrtikr added the important Issue identified as high-priority label Jul 12, 2021
@luabud luabud assigned karrtikr and unassigned paulacamargo25 Jul 14, 2021
@luabud luabud removed info-needed Issue requires more information from poster important Issue identified as high-priority labels Jul 14, 2021
@karrtikr
Copy link

Hi, this is actually expected behavior as we no longer use python.pythonPath setting when in experiment. See #12313 (comment) and #12313 (comment) where we explain it further. We also showed an informational prompt notifying the users which explains this,

The "python.pythonPath" setting in your settings.json is no longer used by the Python extension. If you want, you can use a new setting called "python.defaultInterpreterPath" instead. Keep in mind that you need to change the value of this setting manually as the Python extension doesn’t modify it when you change interpreters. [Learn more](https://aka.ms/AA7jfor).

Closing this.

@david-waterworth
Copy link
Author

@karrtikr yes I know - that's why I raised the issue. Now every single one of my projects is using a random different interpreter to the one I had configured in python.pythonPath. I have to manually open and select the correct one now for every single project - plus I have to do this again for jupyter notebooks in each project as well! My concern isn't around the change, it's the fact that silently between versions my projects started using a different interpreter. What should have happened is when I first open a project in the new version it should have migrated the old settings correctly.

@karrtikr karrtikr reopened this Jul 29, 2021
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 29, 2021
@karrtikr karrtikr removed the triage-needed Needs assignment to the proper sub-team label Jul 29, 2021
@karrtikr
Copy link

Ah I see, apologies. Yes that is undesirable behavior and settings should have migrated automatically. This seems like a bug. I'll verify if I can reproduce it and get back to you soon.

@karrtikr karrtikr added investigating We are looking into the cause of the issue and removed triage labels Jul 29, 2021
@karrtikr karrtikr added triage and removed investigating We are looking into the cause of the issue labels Aug 25, 2021
@karrtikr
Copy link

karrtikr commented Aug 25, 2021

Unfortunately I'm unable to reproduce this issue. We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we can try further using their assistance. But until then I'm afraid there's not much that can be done.

I've updated the title so it's more visible.

@karrtikr karrtikr changed the title Incorrect python interpreter selected after pythonDeprecatePythonPath Extension forgets the Python interpreter for my workspace (pythonDeprecatePythonPath exp) Aug 25, 2021
@Kurt-von-Laven

This comment has been minimized.

@karrtikr karrtikr added investigating We are looking into the cause of the issue and removed triage labels Sep 21, 2021
@karrtikr

This comment has been minimized.

@karrtikr karrtikr added triage and removed investigating We are looking into the cause of the issue labels Oct 13, 2021
@Kurt-von-Laven
Copy link

Thank you, @karrtikr. I realized that eventually and forgot to come back and clear that up. I was misinterpreting the docs.

@karrtikr
Copy link

No problem, if you feel this could have been clearer feel free to open an issue in https://github.com/Microsoft/vscode-docs.

@karrtikr
Copy link

karrtikr commented Jan 6, 2022

Closing in favor of #17977

@karrtikr karrtikr closed this as completed Jan 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

6 participants