How to Solve Pip Command Not Found Error in Bash
The pip
is a package management system written in Python used to install and manage software packages. When you download a package using the pip
tool, you may sometimes get a command not found
error.
This article explains how to install pip
and solve this error in Bash.
Installation of pip
in Bash
The pip
tool can be installed on Linux distributions with the following commands. These commands will also install dependencies required for building modules.
Install pip3
tool for Arch Linux.
sudo pacman -S python-pip
Install pip3
tool for Ubuntu and Debian.
sudo apt-get install python3-pip
Install pip3
tool for Fedora.
sudo yum install python3-pip
Besides these, the pip3
tool can be installed manually. Download the file from the official repository with curl
and save it as get-pip.py
.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Run the file with the python3
command. You can then delete the file.
python3 get-pip.py
rm get-pip.py
You can successfully install the pip3
tool by choosing the one that suits you best from these options. Now you can download the packages you want using the pip3 install package
command.
Solve pip command not found
Error in Bash
You may be using the wrong version if you get a pip: command not found
error while downloading a package. To solve the problem, check the version of the pip
tool you have installed first.
pip --version
pip3 --version
Usually, pip
is used with Python 2.x and pip3
with Python 3.x. If you want to install Python 3.x packages, try typing pip3
instead of pip
.
pip3 install package
If you do not want to type pip3
every time, you can add an alias to the .bashrc
file.
alias pip="pip3"
Alternatively, you can use the pip
with the python3
command.
python3 -m pip install package
Yahya Irmak has experience in full stack technologies such as Java, Spring Boot, JavaScript, CSS, HTML.
LinkedIn