Skip to main content

How to Fix "pip command not found" in Linux


L
inux operating system usually comes with Python installed. Many programs are developed and interpreted using Python. But sometimes while developing programs in Python user might see ` pip command not found error. As newly installed Linux distros do not have pip package as there is no need to just run programs.

If you encounter the error message "pip command not found" in Linux, it indicates that the Pip package manager is not installed or not properly configured. Here are a few steps you can follow to fix this issue:

STEP 1: Install Pip

  1. To open a terminal, you usually can find it in your applications menu or by using a keyboard shortcut (often Ctrl + Alt + T).
  2. Start by installing Pip if it is not already installed. Run the following command:
sudo apt-get install python3-pip

STEP 2: Update PATH variable

  1. After installing Pip, you may need to update your PATH variable to ensure that the system can locate the Pip executable.
  2. Open the .bashrc file in your home directory using a text editor:
nano ~/.bashrc
STEP 3:Add line at the end of file

Add the following line at the end of the file:

export PATH=~/.local/bin:$PATH

g2

export PATH=~/.local/bin:$PATH

Save the file and exit the nano text editor. In nano, you can save by pressing Ctrl + O and then exit by pressing Ctrl + X.

STEP 4: Refresh the terminal:

To make the changes take effect, either restart your terminal or run the following command:

source ~/.bashrc

This command refreshes the terminal to apply the changes made to the .bashrc file.

STEP 5: Verify installation:

Finally, verify that Pip is installed correctly by running the following command:

pip --version
If successful, this command will display the installed Pip version information.

If you see the version information, it means Pip is installed and working correctly.


METHOD 2:

If you are still not able to install pip ,then try executing below commands in your terminal.

Run the following commands to download and run the script to install pip:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

python get-pip.py

python get-pip.py

By following these steps, you should be able to fix the "pip command not found" error in Linux and start using Pip to manage your Python packages.

METHOD 3:

STEP 1 : Download get-pip.py

  1. Open a terminal window.
  2. Navigate to the directory where you want to install pip.
  3. Run the following command:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

STEP 2 :Run the following command to install pip:

python get-pip.py

This will install pip in the current directory.

CONCLUSION

In conclusion,At start of linux distro installation it is generally occurred process that pip command may not be you may not able to find pip .The most common and recommended method to install pip on a Linux system is using the package manager with the following command:

  • In Method 1 ,we had executed following set of commands:
sudo apt-get install python3-pip
nano ~/.bashrc
export PATH=~/.local/bin:$PATH
source ~/.bashrc
pip --version

  • In Method 2, we had used following set of commands to install pip on our linux computer
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

  • In Method 3, we had used the following set of commands to install pip in just two steps:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

This ensures a smooth installation process. However, if you encounter issues or prefer an alternative approach, running the get-pip.py script directly is a viable option.

If you have any further questions or concerns related to this article, feel free to comment below.

Thank you for reading!

Comments

Popular posts from this blog

Free database for beginners for prototype online

For free online databases suitable for beginners in India, here are some reliable options that support SQL and work well for prototyping: Firebase Realtime Database / Firestore Firebase offers a limited free tier and is easy to set up for quick prototypes. It provides both SQL-like Firestore and NoSQL Realtime Database options. The free plan includes 1GB storage and basic analytics. Firebase Console Supabase Supabase is an open-source alternative to Firebase with a PostgreSQL backend, making it a solid choice for SQL beginners. The free tier provides up to 500MB of database space, unlimited API requests, and real-time capabilities. Supabase PlanetScale Based on MySQL, PlanetScale is great for beginners and offers a free plan with 5GB storage and a user-friendly interface. It’s especially suitable for scalable prototypes and integrates well with modern frameworks. PlanetScale ElephantSQL ElephantSQL offers a free tier for PostgreSQL databases with 20MB storage. It’s easy to use and prov...

Best Linux distros of 2023

  Introduction Linux, the open-source operating system, has a plethora of distributions tailored to diverse user needs. These distributions, or "distros," vary in design, focus, and functionalities, making Linux a versatile choice. In this article, we'll explore ten noteworthy Linux distributions and delve into their unique features and capabilities. Distro 1 - Ubuntu Ubuntu is one of the most popular Linux distributions. It's known for its user-friendly interface and robust community support. Ubuntu is based on Debian and offers a balance between ease of use and powerful features. Features of Ubuntu: Desktop Environment : Utilizes the intuitive GNOME desktop environment, providing a clean and efficient interface. Software Repository: Offers an extensive software repository accessed through the APT package manager, ensuring a vast selection of applications. Security and Updates: Regularly provides updates and security patches to enhance system stability and protect ...

Solidity Language

Certainly! Solidity is a programming language primarily used for developing smart contracts on the Ethereum blockchain. Here's a brief overview of some important concepts: 1. Smart Contracts:  These are self-executing contracts with the terms of the agreement directly written into code. They automatically execute actions when predefined conditions are met. 2. Data Types : Solidity supports various data types including uint (unsigned integer), int (signed integer), bool (boolean), address (Ethereum address), and more. 3. Functions:  Functions in Solidity are similar to functions in other programming languages. They can be called by external actors or internally by the contract itself. 4. Modifiers : Modifiers are used to change the behavior of functions. They are often used to perform checks before executing a function. 5. Events:  Events are used to log information that can be accessed outside of the blockchain. They're useful for notifying external applications about act...