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

VSCode not picking up new venv #22717

Closed
valhuber opened this issue Jan 5, 2024 · 9 comments
Closed

VSCode not picking up new venv #22717

valhuber opened this issue Jan 5, 2024 · 9 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@valhuber
Copy link

valhuber commented Jan 5, 2024

Type: Bug

I was happy to discover this /vscode/settings.json: python.defaultInterpreterPath

But, when I set it, and then create a venv manually inside the project, VSCode does not pick it up. Seems to me it should...

python3 -m venv venv; . venv/bin/activate;

Extension version: 2023.23.13541005
VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:48:16.874Z)
OS version: Darwin arm64 23.2.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 5, 4, 3
Memory (System) 32.00GB (0.96GB free)
Process Argv --crash-reporter-id ae96f0d0-ba5f-4c75-ac78-db639bde57c9
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vshan820:30294714
vscorecescf:30445987
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
py29gd2263:30899288
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
azure-dev_surveyone:30548225
89544117:30613380
962ge761:30917236
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2cf:30928864
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
dsvsc019:30917259
cp7184t3:30927821

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 5, 2024
@samamorgan
Copy link

I believe this is the intended functionality. See:

https://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter

Note: Changes to the python.defaultInterpreterPath setting are not picked up after an interpreter has already been selected for a workspace; any changes to the setting will be ignored once an initial interpreter is selected for the workspace.

@valhuber
Copy link
Author

valhuber commented Jan 5, 2024 via email

@karrtikr
Copy link

karrtikr commented Jan 8, 2024

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. Thanks for understanding and the patience!

@yzub
Copy link

yzub commented Jan 9, 2024

Im having a similar issue. I currently have pyenv installed and set globally on my machine. And then within my project I create a virtual env via python3 -m venv venv;

The standard behaviour up until this point has been: vscode would detect the new virtual env and activate it automatically via the source command whenever I opened a new terminal.

This has stopped happening and my terminal is set on the pyenv global interpreter instead. Not sure why this is. Has there been a change here?

@rodri45l
Copy link

Hi, I'm having the same issue, tried uninstalling vscode, updating venv , updating pip... Nothing seems to work, only output I was able to get is : Python virtual environment was successfully activated, even though "(.venv)" indicator may not be present in the terminal prompt. Which I belive is not true...

@MagnusOxlund
Copy link

... If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority....

I just opened #22755 which also affects the ability to select the interpreter, and I would expect the average VS Code user to have quite a time figuring out which component is responsible and where to look for a solution or a bug report (there's VS Code itself, Intellisense, linters, Pylance, and the Python extension).

@karrtikr
Copy link

karrtikr commented Feb 1, 2024

Hi @valhuber, unfortunately I'm unable to reproduce the issue, I do see a notification which shows up when a new environment is created via "python -m venv .venv" command:

image

Could you please provide the Python logs as mentioned in the issue template?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 1, 2024
@karrtikr
Copy link

karrtikr commented Feb 1, 2024

@rodri45l If you still face the issue, please open up a new issue using Python: Report Issue command and we'll be happy to have a look. Make sure to provide the logs.

@brettcannon
Copy link
Member

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

7 participants