-1

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
The_spider
  • 1,202
  • 1
  • 8
  • 18

3 Answers3

1

Here is what you can try.

  1. Lets check python installation.
C:\Users\User>python --version
Python 3.10.5

C:\Users\User>

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:\Users\User>pip --version
pip 22.3 from C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)

C:\Users\User>

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.

Anubhav Sharma
  • 159
  • 1
  • 12
  • İ wrote python --version and i got 2 error:command 'python3' from deb python3 and command 'python' from deb python-is-python3 – Ali Heydarov Dec 17 '22 at 19:56
  • But i wrote python3 --version it worked.But when i wrote pip --version i got error Command 'pip' not found – Ali Heydarov Dec 17 '22 at 19:59
0

3 commands

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

or maybe

sudo apt install <package_name> -y
  • Python modules usually can be installed through `pip3`, but in some cases there's need to install those through package manager, which on ubuntu is `apt` (from debian) or `snap` ( new type of packages developed by Canonical). Add some additional information to your answer and describe steps, what these steps do etc. – Bolderaysky Dec 17 '22 at 19:41
  • İ wrote sudo apt install python3-pip and i got error again. Package python3-pip is not available,but is referred to by another package.This may mean that package is missing,has been obsoleted or is only available from another source E:Package 'python3-pip' has no installation candidate – Ali Heydarov Dec 17 '22 at 20:01
0

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