-
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
Python path from other project's ./.venv being used elsewhere #14461
Comments
I saw something similar -- when Home Brew updated my Python3 to 3.8.6, I rebuilt my venv with the new Python version but VS Code still showed 3.7.5 in some cases until I updated all of my venvs. |
Hi @yajo Thanks for the bug report! 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 will raise this issue's priority. @ddesroches, please note that the extension caches the interpreter information it receives, which might lead to some inconsistencies until the cache is invalidated. In any case, it isn't related to the problem initially reported. Thanks for your understanding and patience! |
I can confirm this behavior, at least with workspaces. Even though I've set an interpreter for the entire workspace (and none for the constituent folders), some folder's interpreter setting might all of a sudden be selected to point to a completely irrelevant project's environment. It can sometimes lead to subtle and very frustrating errors, when you realize after a moment that it's just pointing to the incorrect environment. It seems like the workspace interpreter setting is not respected and that the interpreter instead is selected by some kind of heuristic or something. It's not really helpful. :( I don't want to set the interpreter on a folder level, since I have some folders/projects in multiple workspaces and want (i.e. expect) them to use the interpreter based on the context/workspace they're opened in for the moment. |
A user of AREPL just ran into this too. They have three folders, one with a python 3.5 venv and the other with a python 3.6 venv. AREPL uses the python path from the python extension, but the python extension is reporting 3.5. Here's an example repo you can use to reproduce the issue: https://github.com/Almenon/pythonBugRepro1.git
Expected result: it runs with python 3.6 I also tried selecting python 3.9 as the workspace interpreter and that didn't work either. Note that my default profile is command prompt. Environment data
Perhaps related: #3325 |
Sorry for the delay, is this still happening with the latest version of the extension? We have changed the way we do interpreter discovery and auto-selection in the past couple of releases. |
I haven't hit this problem lately. |
I will close the issue for now then. If you encounter this problem again, feel free to comment here and we'll reopen it, or open a new issue. Thank you! |
Issue Type: Bug
I have one project that has a
.venv
folder, and in that project settings, that's the python path. OK.But then, when I switch to another project, instead of picking a more global python path such as
/usr/bin/python
by default, it defaults to the other project's.venv/bin/python
, which is obviously not for this project.Extension version: 2020.9.114305
VS Code version: Code 1.50.1 (d2e414d9e4239a252d1ab117bd7067f125afd80a, 2020-10-13T14:44:48.716Z)
OS version: Linux x64 5.8.15-201.fc32.x86_64
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: