Search code examples
pythonvisual-studio-codepiplinux-mint

Vscode cant find my installed pip libraries. How can i get my pip libraries used in vscode on linux mint?


I am on Linux Mint. When i try to import robot for robotframework in my python application it doesnt get recognized as a installed library. This while i checked the executable with the "which" command.

which python

Gives the output: /usr/bin/python

I put that path '/usr/bin/python' in the interpreter path in vscode. But it doesn't get the installed libraries.

when i use the terminal outside of vscode and do

pip list

I get a big list with all of my installed libraries. But when i do the same in VScode i just get a short list with nothing of the installed libraries.

I tried to deinstall python, vscode and reinstall both but that doesn't work. The python path to the system python.exe is in the PATH variables. I dont know what i can try further.

It looks like that they both point to the same pip instance but it doesn't recognize the same packages. Like it cant find the site-packages folder

Can anyone please help?


Solution

  • I've found the problem. In Linux Mint when you install visual studio code via the application manager built into the OS. It installs the flatpack version of Visual studio code. Which creates what looks like its own environment that cannot get the pip packages from the main system.

    For me what solved it was to download the .deb version from the official vscode website(https://code.visualstudio.com/Download) and install that one using the:

    sudo apt install /Downloads/{name of downloaded.deb file}
    

    When I used this version of Visual studio code it all worked for me with no problem.