How to Install PIP on Windows

One of the best tools to install and manage Python packages is called Pip. Pip has earned its fame by the number of applications using this tool. Used for its capabilities in handling binary packages over the easy_installed packaged manager, Pip enables 3rd party package installations. Though the newest versions of Python come with pip installed as a default, this tutorial will show how to install Pip, check its version, and show some basic commands for its use.

Python is an open-source programming language that allows you to run applications and plugins from a wide variety of 3rd party sources (or even applications you develop yourself) on your server. Python is cross-platform, meaning that you can run it on a number of different operating systems, including Windows Server OS.

 

Pre-flight Check

Before you can install Pip on your server, you’ll need to confirm that Python is installed.

The simplest way to test for a Python installation on your Windows server is to open a command prompt (click on the Windows icon and type cmd, then click on the command prompt icon). Once a command prompt window opens, type python and press Enter. If Python is installed correctly, you should see output similar to what is shown below:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

If you receive a message like:

Python is not recognized as an internal or external command, operable program or batch file.

Python is either not installed or the system variable path hasn’t been set. You’ll need to either launch Python from the folder in which it is installed or adjust your system variables to allow Python to be launched from any location.

For more information about installing and using Python, see the Python.org website.

 

Installing Pip

Once you’ve confirmed that Python is correctly installed, you can proceed with installing Pip.

  1. Download get-pip.py to a folder on your computer.
  2. Open a command prompt and navigate to the folder containing get-pip.py.
  3. Run the following command:python get-pip.py
  4. Pip is now installed!

You can verify that Pip was installed correctly by opening a command prompt and entering the following command:

pip -V

You should see output similar to the following:

pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)

Now that Pip is installed and configured, you can begin using it to manage your Python packages. For a brief overview of the available commands and syntax for Pip, open a command prompt and enter:

pip help

All of Liquid Web’s Windows core-managed servers can run Python and our support team can assist with installation and verification if needed. ActiveState Python 2.6.5 can be installed on Plesk Fully Managed servers if desired.

How to Install Cassandra on Ubuntu 16.04 LTS

Apache Cassandra is a free open-source database system that is NoSQL based. Meaning Cassandra does not use the table model seen in MySQL, MSSQL or PostgreSQL, but instead uses a cluster model. It’s designed to handle large amounts of data and is highly scalable. We will be installing Cassandra and its pre-requisites, Oracle Java, and if necessary the Cassandra drivers.

Pre-Flight Check

  • We are logged in as root on an Ubuntu 16.04 VPS powered by Liquid Web!
  • Apache Cassandra and this article expect that you are using Oracle Java Standard Edition 8, as opposed to OpenJDk . Verify your Java version by typing the command below into your terminal:

java --version

  • At the time of this article, Python 2.7.11 and later versions will need to install updated Cassandra drivers to fix a known bug with the cqlsh command. You can check your Python version similar to checking your Java version:

python --version

  • If you have Python 2.7.11+ or later, download the required driver by running the pip command. You will need pip installed. Within this tutorial, we will show you how to install pip. However, pip is usually pre-installed with Python by default.

Step 1: Install Oracle Java (JRE)

Cassandra requires your using Oracle Java SE (JRE) installed on your server. First, you will have to add Personal Package Archives to make the (JRE) package available.

sudo add-apt-repository ppa:webupd8team/java

After entering this command, it may prompt you to hit enter to continue.
Once it completes update the package database using the following:

sudo apt-get update

You can now install Oracle JRE with the following:
sudo apt-get install oracle-java8-set-default

A pink screen prompts you to agree to the terms and conditions of JRE. Hit enter to continue from this screen and accept the terms and conditions in the next screen.

Java Installer Screen

 

Once successfully installed verify the default version of Java by typing:

java -version

You’ll receive the following or something very similar :

Java Version Output

 

Step 2: Installing Apache Cassandra

First, we have to install the Cassandra repository to /etc/apt/sources.list.d/cassandra.sources.list directory by running following command (When we made this article Cassandra 3.6 was the current version. You may need to edit this line to reflect the latest release by updating the 36x value. For example, use 37x if Cassandra 3.7 is the newest version.):
echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list

Next, run the cURL command to add the repository keys :

curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -

We can now update the repositories:

sudo apt-get update

 

Note
If you get the following error: GPG error: http://www.apache.org 36x InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A278B781FE4B2BDA
Add the public key by running the following command:
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDARepeat the update to the repositories:
sudo apt-get update

Finally, finish installing by entering the following:
sudo apt-get install cassandra

Verify the installation of Cassandra by running:
nodetool status

The desired output will show UN meaning everything is up and running normally.

Verifying Cassandra is Installed

 

Step 3: Connect with cqlsh

If you have an older version of Python before 2.7.11, you’ll skip this step and start using Cassandra with the cqlsh command. Good for you! You have successfully installed Cassandra!
cqlsh

You should see something similar to this:
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.6 | CQL spec 3.4.2 | Native protocol v4] Use HELP for help.

Note
For future reference, Cassandra’s configuration file, data directory and logs can be found in:

  • /etc/cassandra is the default file configuration location.
  • /var/log cassandra and /var/lib cassandra are the default log and data directories location.

However, if you get the following error,

Connection error: (‘Unable to connect to any servers’, {‘127.0.0.1’: TypeError(‘ref() does not take keyword arguments’,)}),

you’ll update the Cassandra drivers. These drivers have a known bug with Cassandra and later versions of Python. Check your Python version by typing:
python --version

Luckily, I am going to show you how you can fix this error in 3 easy steps by downloading the drivers.

 

Step 3a: First we will need pip installed. If you don’t have it already, you can get it with the following command.

sudo apt-get install python-pip

 

Step 3b: Once pip is installed, run the following to install the new Cassandra driver. Please note this command may take a while to execute. Grab a snack and wait for it to complete. It can take 5-10 minutes to install fully.

pip install cassandra-driver

 

Step 3c: Finally disable the embedded driver by entering :

export CQLSH_NO_BUNDLED=true

You should now be able to run the cqlsh command.

cqlsh

You should see this if successful :

Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.6 | CQL spec 3.4.2 | Native protocol v4] Use HELP for help.

To exit cqlsh type exit:
cqlsh> exit

Congrats! You have successfully installed Cassandra!

Note

Cassandra should start automatically, but you’ll want to stop Cassandra to make any additional configuration changes. Start and stop it with the following:

sudo service cassandra start
sudo service cassandra stop

How to Install Pip on Ubuntu 16.04 LTS

Arguably one of the easiest tools to use for installing and managing Python packages, Pip has earned is notoriety by the number of applications utilizing this tool. Fancied for its capabilities in handling binary packages over the easy_installed packaged manager, pip enables 3rd party package installations. Though Python does sometimes come with pip as a default, this tutorial will show how to install, check its version as well as some basic commands for using pip on Ubuntu 16.04.

 

Pre-Flight Check

  • These instructions are intended for an Ubuntu 16.04 LTS server, and we are logged in as root.
  • If you are using a different operating system, check out our other pip installation guides.

Step 1: 

Ensure that all packages are up-to-date. After running the command below, you’ll get an output of any packages getting their update.

apt-get update

Step 2:

Install pip with cURL and Python. Downloading using the cURL command ensures the latest version of pip.curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py

Step 3: 

Verifying the installation of pip:

pip --version

Output:
pip --version
pip 18.0 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Installing Libraries

Pip can install 3rd party packages like Django, Tensorflow, Numpy, Pandas and many more with the following command.

pip install <library_name>

 

Searching for Libraries

You can also search for other libraries in Python’s repository via command line. For our example let’s look for Django packages. The search command shows us an extensive list similar to the one below.

pip search django
django-bagou (0.1.0) - Django Websocket for Django
django-maro (0.0.2) - `django-maro` is utility for django.
django-hooked (0.1.7) - WebHooks for Django and Django Rest Framework.
django-ide (0.0.5) - A Django app to develop Django apps
django-mailwhimp (0.1) - django-mailwhimp integrates mailchimp into Django
django-six (1.0.4) - Django-six —— Django Compatibility Library
django-umanage (1.1.1) - Django user management app for django
django-nadmin (0.1.0) - django nadmin support django version 1.8 based on django-xadmin
diy-django (1.3.1) - diy-django

 

Uninstalling a Library

If you don’t need the library and your scripts use them you can uninstall easily with this command:

pip uninstall

 

Installing Python Resources

Many times Python packages have a requirements.txt file, if you see this file, you can run this command to install all libraries in that package

pip install -r requirements.txt

 

How To Install Pip on Fedora 23

Pip is a tool for installing and managing packages for Python. The popular Python programming language is considered one of the easiest to learn because of its emphasis on code readability.

Pre-Flight Check

  • These instructions are intended specifically for installing Pip on Fedora 23. If you’re using a different operating system, check out our guides to installing pip on Fedora 21 and CentOS 7.
  • We’ll be working from a Liquid Web Self Managed Fedora 23 server and logging in as root.

Step #1: Install Pip

First, we’ll clean up our packages:

dnf clean all

As a matter of best practice we’ll now also update our packages:

dnf -y update

Now we’ll install python-pip and any required packages:

dnf -y install python-pip

Step #2: Verify the Installation

View a list of helpful commands:

pip --help

Check the version of Pip that is installed:

pip -V

Which should yield a result similar to:

pip 7.1.0 from /usr/lib/python2.7/site-packages (python 2.7)
 

How to Install or Upgrade Django Using Pip

Django is a Python web framework; it’s free, open source, and often used with complex, database-driven websites.

Pre-Flight Check
  • These instructions are intended specifically for installing Django, a Python web framework.
  • I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.

Continue reading “How to Install or Upgrade Django Using Pip”

How to Install an Object Storage Python Library (boto)

boto is a python library that enables a user to interact with Storm Object Storage, as well as other web services by Amazon, Google, and OpenStack.

Pre-Flight Check
  • These instructions are intended specifically for installing boto, a python library for managing Storm Object Stores.
  • I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.

Continue reading “How to Install an Object Storage Python Library (boto)”

How to Install Pip on Fedora 21

Pip is a tool for installing and managing Python packages.

Python is a programming language. It is quite popular and has a design philosophy that emphasizes code readability. It is widely considered to be a very easy programming language to learn and master because of its focus on readability. Python is open source, and will run a multitude of platforms including, but not limited to: Various Linux/UNIX distributions (CentOS, Ubuntu, Fedora, Debian, etc.), Microsoft Windows, and Mac OS X.

Pre-Flight Check
  • These instructions are intended specifically for installing Pip, a tool for installing and managing Python packages.
  • I’ll be working from a Liquid Web Self Managed Fedora 21 server, and I’ll be logged in as root.

Continue reading “How to Install Pip on Fedora 21”

How to Install Pip on Fedora 20

Pip is a tool for installing and managing Python packages.

Python is a programming language. It is quite popular and has a design philosophy that emphasizes code readability. It is widely considered to be a very easy programming language to learn and master because of its focus on readability. Python is open source, and will run a a multitude of platforms including, but not limited to: Various Linux/UNIX distributions (CentOS, Ubuntu, Fedora, Debian, etc.), Microsoft Windows, and Mac OS X.

Pre-Flight Check
  • These instructions are intended specifically for installing Pip, a tool for installing and managing Python packages.
  • I’ll be working from a Liquid Web Self Managed Fedora 20 server, and I’ll be logged in as root.

Continue reading “How to Install Pip on Fedora 20”

How to Install Pip on Ubuntu 12.04 LTS

Pip is a tool for installing and managing Python packages.

Python is a programming language. It is quite popular and has a design philosophy that emphasizes code readability. It is widely considered to be a very easy programming language to learn and master because of its focus on readability. Python is open source, and will run a multitude of platforms including, but not limited to: Various Linux/UNIX distributions (CentOS, Ubuntu, Fedora, Debian, etc.), Microsoft Windows, and Mac OS X.

Pre-Flight Check
  • These instructions are intended specifically for installing Pip, a tool for installing and managing Python packages.
  • I’ll be working from a Liquid Web Core Managed Ubuntu 12.04 LTS server, and I’ll be logged in as root.

Continue reading “How to Install Pip on Ubuntu 12.04 LTS”

How to Install Pip on Ubuntu 14.04 LTS

Pip is a tool for installing and managing Python packages. Python is a programming language that is quite popular and has a design philosophy that emphasizes code readability. It is widely considered to be a straightforward  programming language to learn and master because of its focus on readability. Python is open source, and will run a multitude of platforms including, but not limited to: Various Linux/UNIX distributions (CentOS, Ubuntu, Fedora, Debian, etc.), Microsoft Windows, and Mac OS X.

Pre-Flight Check
  • These instructions are intended specifically for installing Pip, a tool for installing and managing Python packages.
  • I’ll be working from a Liquid Web Core Managed Ubuntu 14.04 LTS server, and I’ll be logged in as root.

Continue reading “How to Install Pip on Ubuntu 14.04 LTS”