Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Intellisense not working with Conda Python environment

Tags:

Intellisense: not working with conda (above), working fine when normal Python (below)

As shown above, Intellisense does not work in VS Code when Conda Environment is set as Python interpreter, it is just keeps “Loading…”. When normal Python interpreter is set (that comes when installing Python extension), Intellisense is working fine. There are no problems to run or debug files with both environment, only issues is Intellisense in Conda Environment.

I have tried at least following things without any success.

  • Restart VS Code several times
  • Uninstalled and re-installed Anaconda Extension Pack (which installs Python extension)
  • Run Python “Build Workspace Symbols” as suggested in How to enable intellisense for python in Visual Studio Code with anaconda3?
  • I also tried command conda init powershell
  • Opening VS Code from Anaconda Prompt as suggested in vscode IntelliSense / code completion doesn't work when I am not in base conda environment

System info:
Version: 1.47.3 (user setup)
Commit: 91899dcef7b8110878ea59626991a18c8a6a1b3e
Date: 2020-07-23T13:12:49.994Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.16299

like image 953
Antti Mäki Avatar asked Aug 12 '20 11:08

Antti Mäki


1 Answers

I found a similar problem, they solve it through explicitly set the python.pythonPath, you can refer to this page.

In your problem, only when selecting the conda interpreter the Intellisense not work as the Intellisense was provided by the Language Server, Could you try these?

  1. Select a different Language Server, The Language Server includes: 'Jedi'(build-in Python extension ), 'Microsoft', 'Pylance'(need install Pylance extension).

  2. downgrade or upgrade the 'Python' extension.

If it still not work, you can try these to find more information which will be helpful to solve the problem:

  1. Look in the OUTPUT panel, select the 'Python Language Server' channel to check whether the Language Server works well.

  2. Open Help -> Toggle Developer Tools select the Console panel to take a check.

like image 135
Steven-MSFT Avatar answered Oct 02 '22 16:10

Steven-MSFT