Vscode: There Is No Pip Installer Available in the Selected Environment

Getting error while saving python file: There is no Pip installer available in the selected environment

You obviously have installed multiple Python environments on your system. The one in /usr/bin is usually the one installed by your system's package manager (apt on Debian) and most probably the default one that is used if you just call the python commands without absolute path from your shell. You can verify that by calling:

which python3
which pip3

I assume that both binaries are used from /usr/bin/.

Your Python installation selected in VS code is located in /usr/local/bin, which probably has been installed from a different origin (maybe you have compiled Python from source?). If VS code complains that no pip has been found in your selected environment, probably /usr/local/bin/pip3 does not exist for some reason. You can verify that by calling:

ls /usr/local/bin/pip3

Easiest solution to this would be to select the /usr/bin/python3 environment in VS code.

If you really need the Python version from /usr/local/bin, find out where this installation came from and complete it in order to have pip3 there as well.

The most sustainable solution, however, would be to use a virtual environment. This would make your Python version system-independent and you have full control over the packages in there.

Install pip3 and flake8 in conda venv on VS Code

I suggest you create a conda environment properly:

conda create -n "myenv" python

then, activate the environment:

conda activate myenv

finally, install flake:

pip install flake8

How to use pip with Visual Studio Code

I am pretty sure your problems of VSCode not finding the correct version of Python will be resolved if you add your ( Python 3.6 installation ) location to the system path.



Related Topics



Leave a reply



Submit