Install Python’s PIP Part Two

This article may also seem a bit unusual because I covered how to install Python’s PIP in the last article. This article is the second part of that. This is something that seemed like it should be two articles, so it is two articles.

Additionally, I share this information so that I can write future articles. So, by themselves, these two articles won’t accomplish much by themselves. They will come in handy for future reference and that’s the point of this.

In the previous article about how to install Python’s PIP, you learned the basics. In that article, you learned how to install PIP. That’s all well and good, but then you might be confused when you go to install a package installed by PIP.

During the package installation, you may see a warning that looks like this:

This is because PIP installs the packages somewhere like your ~/local/.bin directory. If you then try to run the package from the terminal, it won’t be found. 

For the record, this is for people using Bash. I’m not sure about other shells.

You can still use PIP packages just fine, you just have to specify the path. That’s a pain in the butt and not something you should have to do. Instead, we’re going to add the path as suggested. If you’ve done that, you can just type the package name into the terminal to run your PIP-installed Python applications.

So, let’s do that…

Install Python’s PIP Part Two:

By now it should be obvious that this requires an open terminal. You did read the first article, right? As such, you can usually open your terminal with your keyboard, simply press CTRL + ALT + T, and your default terminal should open.

With your terminal open, we need to add some text to your ~/.bashrc file that sets the path. It’s pretty straightforward and we’ll be using Nano for this. Click that link if you’re not sure if you have Nano installed.

Let’s open the file for editing with this command:

Then scroll to the bottom.

At the bottom, add a new line.

Copy and paste the following:

Next, we save the changes and exit Nano by pressing CTRL + X, then Y, and then ENTER on your keyboard.

No changes will have been made just yet. You could reboot or reload your desktop session if you wanted, but you can tell the shell to reload the file and thus have the changes take effect. To do that, you’d enter this:

At that point, you can install PIP packages and have them run when you just type the command into the terminal. There’s no need to add anything else to the command. This sets the path that PIP was complaining about.

And now you’re ready to install Python PIP packages. This is an important step after you install Python’s PIP. It should serve you well, assuming you want Python packages installed in a pretty simple manner.

IMPORTANT: Read Part 1 to install Python’s PIP.

Closure:

As you can tell by the length, there’s a reason that this is a second article. I’ll have to remember to edit the first article when this article gets published. It’s not that it’s complicated, it’s just long.

So, it seemed best to turn this into a second article – especially because it’s not technically a necessary step. You can comfortably run Python packages by using the file path, but this is much easier.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Last Updated on February 18, 2024 by KGIII

Subscribe to Newsletter!
Get notified when new articles are published!
We promise to never share your email!
icon

Author: KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.