pip3: command not found but python3-pip is already installed
Run
locate pip3
it should give you a list of results like this
/<path>/pip3
/<path>/pip3.x
go to /usr/local/bin to make a symbolic link to where your pip3 is located
ln -s /<path>/pip3.x /usr/local/bin/pip3
pip[3] command not found even though pip is installed
run this command, if you are woring on python3.
pip3 install -r requirements.txt
from you error code it looks like you are running pip[3] , which is wrong.
for python2, you can run
pip install -r requirements.txt
pip3: command not found
You would need to install pip3.
On Linux, the command would be: sudo apt install python3-pip
On Mac, using brew, first brew install python3
Then brew postinstall python3
Try calling pip3 -V
to see if it worked.
python3 and pip is installed on mac but pip3 command not found
pip
and pip3
are just two different names for the same program. Essentially, the only difference is the paths they are hard-coded to install into; pip
is typically a version that installs to a Python 2 installation, and pip3
to a Python 3 installation.
Inside your virtual environment, though, there typically is only one Python installation available; the purpose of the virtual environment is to provide "the" installation to use. As such, it simply uses names like pip
and python
for the commands rather than providing any kind of version-specific names. The names refer to whatever specific version was used to create the virtual environment.
Ubuntu Command 'pip' not found, but there are 18 similar ones
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.
Why can't I run pip on Windows Terminal (Ubuntu profile)
You likely have at least two different issues going on.
First, with the alias
, you are attempting to use the Windows Python and pip with WSL/Linux/Ubuntu. You'll find multiple questions and answers here on Stack Overflow on why that isn't a good idea (even if you can get it to work).
Ubuntu already includes Python3 in WSL, and you should use that version if you are trying to develop in Ubuntu/WSL.
As for the sudo apt install python-pip
failing, as noted it should be python3-pip
.
As for the sudo apt install python3-pip
failing, that's likely because you just installed WSL2/Ubuntu. When installed most distributions under WSL, the repository caches do not come pre-populated, in order to save on bandwidth when installing.
It's always a good practice to sudo apt update
before installing software, but it's required that you do it at least the first time on WSL/Ubuntu.
Try that, then sudo apt install python3-pip
.
Why can't I use the pip3 that comes from Windows in WSL2 Ubuntu
To use pip3 on WSL-2 you need to force using the ".exe" binary on your command line:
pip pip.exe pip3 pip3.8 pip3.8.exe pip3.exe
^ not work ^ work ^ not work ^ not work ^ work ^ work
You will also need to install Python under Windows beforehand.
Related Topics
How to Cleanly Uninstall Ansible
Python, Anaconda, Spyder - Uninstalling Python Package Using Pip Does Not Work in Spyder + Ipython
Python Pip Install Fails: Invalid Command Egg_Info
Read CSV from Google Cloud Storage to Pandas Dataframe
What Is the Most Efficient Way to Sum a Dict With Multiple Keys by One Key
Python-3: Why This Following Code Returns None in Print Statement
Unit Testing a Method With No Return Value
Moving Position of Character Within an Item in List
How to Change the Title Bar in Tkinter
Finding the Maximum Number of Columns in a File or CSV Using Python
How to Split a CSV File Row to Columns in Python
How to Get a Fields Particular Value of Json in Python
How to Change a Dataframe Column from String Type to Double Type in Pyspark
Pip3: Command Not Found But Python3-Pip Is Already Installed
Python Login Script; Usernames and Passwords in a Separate File
How to Test Multiple Variables for Equality Against a Single Value