P.S:
I have been using vs code for a while now and found an another way to show virtual environments in vs code.
Go to the parent folder in which venv
is there through command prompt.
Type code .
and Enter. [Working on both windows and linux for me.]
That should also show the virtual environments present in that folder.
Original Answer
I almost run into same problem everytime I am working on VS-Code using venv. I follow below steps, hope it helps:
Go to File > preferences > Settings
.
Click on Workspace settings
.
Under Files:Association
, in the JSON: Schemas
section, you will find Edit in settings.json
, click on that.
Update "python.pythonPath": "Your_venv_path/bin/python"
under workspace settings.
(For Windows): Update "python.pythonPath": "Your_venv_path/Scripts/python.exe"
under workspace settings.
Restart VSCode incase if it still doesn't show your venv.