vscode IntelliSense / code completion doesn't work when I am not in base conda environment

Viewed 709

When I change my project to another conda environment than base environment, python code completion doesn't work anymore for installed modules (like cv2).

I have no problem detecting the environment or running my code though. How can I fix it ?

2 Answers

Open your Anaconda Prompt, activate the environment, and then launch VS Code from within the activated environment (i.e. code .).

I had the same problem in mac os. The problem was with the "Language Server" setting in the python extension, which is by default "Jedi". I changed it to "pylance" and it solved my problem. To use pylance you have to install the pylance extension.

Related