[FIXED] Visual Studio Code does not detect Virtual Environments

Issue

Visual Studio Code does not detect virtual environments. I run vscode in the folder where the venv folder is located, when I try to select the kernel in vscode I can see the main environment and one located elsewhere on the disk. Jupyter running in vscode also doesn't see this environment. I have installed ipykernel in this environment. I tried to reinstall vscode and python extension.

I tried to set the path in settings.json inside .vscode:

{
    "python.pythonPath": ".\\venv\\Scripts\\python.exe"
}

Windows 10
Python 3.6.7 (64-bit)
VSCode 1.54.3


Solution

OK, I found a solution. Firstly uninstall Visual Studio Code. Go to C:\Users\Your_profile and delete the folders related to Visual Studio Code that start with a period. Then turn on showing hidden folders and go to C:\Users\Your_profile\AppData. Type vscode in the file finder and remove all foders and files related to Visual Studio Code. Finally, install Visual Studio Code and enjoy the virtual environments. :)



Answered By - Robert Bukowski
Answer Checked By - Pedro (Python.Easybugfix Volunteer)

Related Posts

Post a Comment