---
title: "Installing packages"
date: "2015-01-20"
category: "python"
slug: "installing-packages"
---

## Overview

Python uses [pip](https://pypi.python.org/pypi/pip) for package management. pip is available on [[determining-platform-version]] and above. [[is-terminal-access-available]] is required.

**Platform note:** On older platforms (pre-v6), use `pip-python` instead of `pip`. The syntax is otherwise identical.

All packages are installed under `/usr/local/lib/python/_<VERSION>_`. Python versions can be switched using [[changing-python-versions]].

## Installing Packages

Use `pip install PKGNAME` where PKGNAME is a package listed in the [Python Package Index](https://pypi.python.org/pypi).

To install Django: `pip install django`

`` `[myuser@sol ~]$ pip install django Downloading/unpacking django Running setup.py egg_info for package django` ``warning: no previously-included files matching '\_\_pycache\_\_' found under directory '\*' warning: no previously-included files matching '\*.py[co]' found under directory '\*' Installing collected packages: django Running setup.py install for djangowarning: no previously-included files matching '\_\_pycache\_\_' found under directory '\*' warning: no previously-included files matching '\*.py[co]' found under directory '\*' changing mode of /usr/local/bin/django-admin.py to 775 Installing django-admin script to /usr/local/bin Successfully installed django Cleaning up...

### Installing to Your Home Directory

To install a package to your [[home-directory-location]] (Python 2.6+), use the `--user` flag:

`pip install --user django`

The package will be installed under `~/.local/lib/`.

## Listing Packages

To view locally installed packages: `pip list`

To search for remote packages: `pip search PKGTOKEN`

Pipe long output to `less` for easier reading: `pip search PKGTOKEN | less`

``` `` `[myuser@sol ~]$ pip search django-a` `` ```django-autocomplete-light - Fresh autocompletes for Django django-angular-scaffold - AngularJS Scaffolding for Django django-alert - Send alerts, notifications, and messages based on events in your django application django-admin-sortable - Drag and drop sorting for models and inline models in Django admin. django-quickapi - The Django-application for the fast organization API.

## Removing Packages

`pip uninstall PKGNAME`

## Upgrading Packages

`pip install --upgrade PKGNAME`
