# Installing Python Packages

DevFeed: [Installing Python Packages](<https://devfeed.tech/articles/installing-python-packages-41102.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2011/11/01/Installing-Python-Packages/>)

Author: Map

Published: 2011-11-01T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [pip](<https://devfeed.tech/topics/pip.md>), [PyPI](<https://devfeed.tech/topics/pypi.md>), [Django](<https://devfeed.tech/topics/django.md>)

Tags: [install](<https://devfeed.tech/tags/install.md>), [pypi](<https://devfeed.tech/tags/pypi.md>), [python](<https://devfeed.tech/tags/python.md>), [python-packages](<https://devfeed.tech/tags/python-packages.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [version](<https://devfeed.tech/tags/version.md>)

## AI overview

A tutorial on installing Python packages with pip, using a virtualenv environment, and recording installed package versions for sharing through a requirements list. It explains that packages are hosted on PyPI and demonstrates creating, activating, and deactivating an isolated project environment.

## Source excerpt

Now that you have you system and project environment all setup you probably want to start developing. But you likely don't want to start writing an entire project fully from scratch, as you dive in you'll quickly realize theres many tools helping you build projects and sites faster. For example making a request to a website there's Requests, for handling processing images there's Python Imaging Library, or for a full framework to help you in building a site there's Django. With all of these there's one simple and common way to install them. But first a little more on how it all works. All major Python packages are hosted on PyPi (Pronounced Pi-P or Cheeseshop). When you use a common python installer it will: Search for the package you specify If you specify a version will use it, otherwise will use the latest Will download the source for that package Install it into your Python environment Now for actually installing... Lets get started with installing the three packages below. At this point you should at least have a fresh Python environment, however you don't have an immediate way to install packages. The defacto Python package installer is pip. Earlier we setup virtualenv to help isolate our python packages we were working with. First lets go ahead and create a folder for our project then setup a new environment for the project we'll work on: $ mkdir myapp $ cd myapp $ virtualenv --no-site-packages venv If we list the contents of the directory you'll now see a folder venv. Within this folder you'll find all the parts of the environment that virtualenv just created: $ ls venv $ ls venv bin include lib Now you've got a sandboxed environment that exists but you haven't loaded it. You can now activate and deactivate this any time you like. Once you do this it customizes your path to use the packages you've installed for this environment. To load your environment when in the myapp directory: $ source venv/bin/activate To deactivate this simple: $ deactivate Now that we'