skip to Main Content

I’m getting an error "There is no Pip installer available in the selected environment." when saving python files in Visual Studio Code. I have pip3 installed, and it’s available from the terminal. I have selected the python interpreter in the VS Code. I also tried manually installing autopep8 with pip3 in the project directory. But the error still occurs. Unfortunately, these are the only solutions I was able to find on the internet, but none of them worked. I use Lenovo’s Chromebook, which is Debian-based. Does anyone have any clue how to solve the issue?
Message when saving

The Error

Selected interpreter:
Selected Python interpreter

2

Answers


  1. I think you should check in your terminal "pip3 freeze" command, if it shows some list , then pip is working, otherwise you should check the environment variable in your system for pip3.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search