Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python autocomplete in VS Code not working with external libraries in conda environment

I have installed several libraries into a conda environment named "foo". I am using Visual Studio Code as my IDE.

Autocomplete works fine for almost all packages, except for the library "openmesh" (see below): Autocomplete with openmesh

Autcomplete with a different library

I have selected the correct python interpreter in VS Code: Interpreter

As confirmed in the bottom left corner.

Version

Furthermore, I have tried to add it to the autocomplete path in the settings of VS Code, however, there was no change, even after relaunching.

Extra Paths

Autocomplete works fine with PyCharm, as seen here: Pycharm

What am I doing wrong?

like image 325
tlk13 Avatar asked May 01 '26 18:05

tlk13


2 Answers

Had a similar problem, auto-completion was not working with python.

The following worked for me:

Use the keyboard shortcut to open the command palette:

Ctrl + Shift + P

and search for:

Python: Restart Language Server

Hit enter. Now give it another try.

like image 108
Youssef al-Tai Avatar answered May 04 '26 08:05

Youssef al-Tai


https://code.visualstudio.com/docs/python/environments : There are two types of environments that you can create for your workspace: virtual and conda environments.

you have to work into a workspace

like image 35
Daniel L Avatar answered May 04 '26 07:05

Daniel L