Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu Command 'pip' not found, but there are 18 similar ones [closed]

I am trying to install a toolkit, I'm on WSL using ubuntu - I downloaded ubuntu yesterday. Here is what the installation process looks like for this toolkit. On windows cmd it says I have python 3.7.9 but on ubuntu its saying I have python 3.8.2

git clone https://github.com...
cd program
pip install -e .

or:

pip install program

pip install -e . is not working for me, I get this error:

user@DESKTOP-REA10BN:~/gym$ pip install -e .

Command 'pip' not found, but there are 18 similar ones.

however, I checked and I have pip installed, here's what I checked for before running:

user@DESKTOP-REA10BN:~$ cd\
> sudo apt-get install python-pip
cdsudo: command not found
user@DESKTOP-REA10BN:~$ python3 --version
Python 3.8.2
user@DESKTOP-REA10BN:~$ python3-pip --version
python3-pip: command not found
user@DESKTOP-REA10BN:~$ which pip3
/usr/bin/pip3
user@DESKTOP-REA10BN:~$ pip3 -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

my PATHS:

/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2020.812.0_x64__79rhkp1fndgsc:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Users/user/AppData/Local/Programs/Python/Python37-32/Scripts/:/mnt/c/Users/user/AppData/Local/Programs/Python/Python37-32/:/mnt/c/Users/user/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/user/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin
like image 460
Aaron R Avatar asked Oct 01 '20 21:10

Aaron R


People also ask

How do I fix command not found pip?

The first and foremost thing to do is to check if you have already installed pip in your machine. In windows, you can check if the pip is located in the below directory. So just navigate to the directory and do check for pip.exe or pip3.exe files. If it's not present, then you need to install it.

Why pip is not recognized?

PIP installation is not added to the system variable – In order to be able to run Python commands from a CMD window, you will need to add the path of your PiP installation to your PATH in the system variable. If you installed Python using the installation executable, it should be added automatically.


2 Answers

Short answer: Try running python3 -m pip install -e .


Some explanations:

The different versions of Python are not surprising. WSL is, effectively, an ultra-lightweight virtual machine. Your Windows python installation is entirely independent of the WSL python installation.

Python has two widely used major versions, Python 2 and Python 3. The command python runs some minor version of Python 2, while the command python3 runs some minor version of Python 3. Below is my console output.

lawruble@Balrog:~/scratch$ python --version
Python 2.7.18
lawruble@Balrog:~/scratch$ python3 --version
Python 3.8.5

Pip is the python installation manager, and has the same major versions as Python. The command pip runs the Python 2 version of pip, while pip3 runs the Python 3 version of pip.

It's better practice to use python3 -m pip over pip3, it helps ensure that you're using the version of pip associated with the version of python you expect to run.

like image 179
lawruble13 Avatar answered Oct 29 '22 19:10

lawruble13


Trying doing these first/again

  1. Updating package info
sudo apt-get update
  1. Downloading all upgrades
sudo apt-get upgrade
  1. Reinstalling pip
sudo apt-get install python3-pip

Clearly the issue's with terminal, i.e. not recognizing the command so maybe pip isn't installed properly, but with what you've shown so far I don't think this issue should arise. Anyways give it a try.

Also

What are you trying to install? pip is for python packages right.

like image 42
Yuvraj Singh Avatar answered Oct 29 '22 18:10

Yuvraj Singh