How To: Install PIP In Linux

Today’s article is going to teach you how to install PIP in Linux. PIP is a reverse acronym meaning ‘PIP Installs Packages” and it’s a handy tool for the installation and management of Python applications. This article should be pretty short and easy for anyone to understand. 

This article is going to be pretty basic, merely telling you how to install PIP and not a whole lot more. The reason I write this article is because it needs to be written. I should also point out that Python is a programming language, though I’d expect most visitors to know that already. But, yes, this article needed to be written.

See, I wanted to tell you about a lovely piece of software (or three), but they all need to be installed with PIP. So, rather than write out the long installation instructions for various distros and package managers each time, I figured I’d make a single article that told you how to install PIP.

That’ll save some time and effort. I can refer back to this when those articles are written. There are many Python applications that can be installed with relative ease – just like you’re installing from your regular Linux repositories. PIP’s Python applications can be installed and uninstalled in the terminal while using PIP, so it’s quite easy.

So then, let’s learn how to…

Install PIP In Linux:

Installing PIP requires a terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have the terminal open, you can install the appropriate PIP. Most folks will be using Python 3, but a smattering of people will still be using Python 2. I will list the installation instructions, where applicable, with Python 2’s instructions first.

Debian/Ubuntu/derivatives:

SUSE/openSUSE/derivatives:

Fedora/derivatives:

RHEL/CentOS/derivatives:

Arch/Manjaro/derivatives:

Slackware:

Read Install PIP For Slackwaare Instructions.

The basic usage of PIP is pip install <package>, pip uninstall <package>, and pip search <package>. My readers are smart enough to understand that without further instructions. You can also learn a lot by using man pip. Now you know how to install PIP in Linux.

Closure:

And there you have it. You have an article telling you how to install PIP in Linux, enabling you to install Python packages/programs quickly and easily inside the Linux terminal. It’s also one more article in my series of articles. I’m now well within a month of when the project is allowed to end and I still have a lot of articles left in me, so I’d expect it to keep going for long into the future. Or at least until someone steps up and takes the site over for me.

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Start A Quick Python Server

Today’s article is going to show you how to transfer files between computers by using a quick Python server. It’s remarkably easy! It’s a temporary server (usually) and lasts only as long as you need it to.

Why would you do this? Well, you can transfer files from one computer to another. It also functions as an HTTP server which makes it easy to test things like simple web pages quickly and easily.

Are there better options? Quite probably. If you want to transfer a single file, then SCP is a good way to go about it. If you want to transfer multiple files, you could setup SFTP. If you want to test web pages, you can likely just write the files locally and then open them up with the browser of your choice.

You have options! And, thankfully, Linux provides all sorts of options – including setting up a quick Python server. As I said, it’s actually pretty easy.

A Quick Python Server:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

The first command I want you to run will let us know what version of Python you have installed. Many distros have (at present) moved onto version 3, but some still have Python 2 installed. So, for that information you just run:

Now, if you have Python v. 2.x, you would use this command:

If you’re using Python v. 3.x then the command you’d use is:

(If you’re curious, the -m is telling Python which module to open.)

Anyhow,  you can now connect to your server with the following command:

Read how to find your IP address. Instead of an IP address, you can also use your hostname.

Anyhow, you  now have a server running on port 8000. If you want to, you can also change the port number. This is the same for both commands. In both cases, just append your chosen port number to the command. Like this:

It’d look a little like this:

See? It's a different port number.
Note the changed port number. You should probably avoid reserved ports.

When you’re done with the quick Python server, you can just close it by pressing CTRL + C. If you’re planning on running it long term, you can always run the command with nohup. If applicable, you may also need to open the port in your firewall.

Like I said, it’s a quick and easy server in Python. You definitely wouldn’t want to use this as a public facing server, but it’s fine for quick tasks. Feel free to leave a comment letting folks know how you use this in  your day-to-day tasks.

Closure:

There you have it, another article said and done! The site is going well and the schedule seems to be working well enough. It’s a bit demanding to write one every other day, but that’s what I said I’d try to do. So far, so good!

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.