skip to Main Content

I can’t install a package with the pip or pip3 command and I can’t install it from the Python Interpreter in PyCharm too. I can’t tap on the ‘+’ at the Python Interpreter in PyCharm.
I get this error:

pip command not found

3

Answers


  1. 3 commands

    sudo apt update
    sudo apt install python3-pip
    pip3 install <package_name>
    

    or maybe

    sudo apt install <package_name> -y
    
    Login or Signup to reply.
  2. Here is what you can try.

    1. Lets check python installation.
    C:UsersUser>python --version
    Python 3.10.5
    
    C:UsersUser>
    

    If you get the version as 3.x, then we are good, else goto your python installation directory and copy its path and then add it to your environment variable PATH.

    1. Check PIP available or not.
    C:UsersUser>pip --version
    pip 22.3 from C:UsersUserAppDataLocalProgramsPythonPython310libsite-packagespip (python 3.10)
    
    C:UsersUser>
    

    if above didn’t work then add pip path to PATH environment variable which would be something similar to above output.

    1. Now we are ready to install any package

    Just do pip install package-name
    for testing, you can try:
    pip install numpy
    If it still throws error, try below one
    python -m pip install numpy
    if it still throws error, then you might need to clean your python installation.

    Login or Signup to reply.
  3. It looks like you don’t have pip installed on $PATH. The following command will run pip without any adjustments to $PATH:

    python3 -m pip install <some_module>
    

    Pay attention to the -m, this stands for modules and runs the pip program inside the python3 interpreter (I don’t know exact definition here, if anyone wishes to correct me I will update the answer)

    However, if this doesn’t work then you may not have pip installed, and can be installed by running:

    python3 -m ensurepip --upgrade
    

    Then, reload your shell via the following (replace bash with your shell):

    exec bash
    

    Running pip --version should now work

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