• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
PythonForBeginners.com

PythonForBeginners.com

Learn By Example

  • Home
  • Learn Python
    • Python Tutorial
  • Python Basics
    • Comments
    • Functions
    • Lists
    • Loops
    • Strings
    • Syntax Basics
  • Code Examples
  • Categories
    • Basics
    • Code Snippets
    • Python On The Web
    • Scripts
    • System & OS
    • Dictionary
    • Modules In Python
    • Lists
    • Modules
    • OS


You are here: Home / Basics / Python : Easy_Install Package Manager

Python : Easy_Install Package Manager

Last Updated: May 22, 2020

Easy_Install Package Manager


This post will be the first in a series of "Python Packing Manager" posts.

To know which one you are going to use, can be hard, as there are a few
different ones to choose from.

Let's start out with Easy_Install.

easy_install


Distributes Python programs and libraries (based on the Python Eggs wrapper)

It's a python module (easy_install) that is bundled with setuptools.

It lets you automatically download, build, install, and manage Python packages.

Easy_Install looks in the Python Package Index (PyPI) for the desired packages
and uses the metadata there to download and install the package and its
dependencies. 

It is also hosted itself on the PyPI.

Python Eggs


A Python egg is a way of distributing Python packages. 

"Eggs are to Pythons as Jars are to Java..."

For a great introduction about this, I suggest you head over to this post

setuptools


setuptools is a collection of enhancements to the Python distutils that allow
you to more easily build and distribute Python packages, especially ones that
have dependencies on other packages.

Easy_Install Usage

Downloading and Installing a Package

For basic use of easy_install, you need only supply the filename or URL of a 
source distribution or .egg file (Python Egg). 

By default, packages are installed to the running Python installation's
site-packages directory.

Easy_Install Examples


Install a package by name, searching PyPI for the latest version, 
and automatically downloading, building, and installing it:
>>easy_install SQLObject

Install or upgrade a package by name and version by finding links on
a given "download page":
>>easy_install -f http://pythonpaste.org/package_index.html SQLObject

Download a source distribution from a specified URL, automatically
building and installing it:
>>easy_install http://example.com/path/to/MyPackage-1.2.3.tgz

Install an already-downloaded .egg file:
>>easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg

Upgrade an already-installed package to the latest version listed on
PyPI:
>>easy_install --upgrade PyProtocols

Install a source distribution that's already downloaded and extracted
in the current directory (New in 0.5a9):
>>easy_install .

Upgrading a Package


You don't need to do anything special to upgrade a package

Just install the new version, either by requesting a specific version, e.g.:
>>easy_install "SomePackage==2.0" 

If you're installing to a directory on PYTHONPATH, or a configured "site"
directory (and not using -m), installing a package automatically replaces
any previous version in the easy-install.pth file, so that Python will
import the most-recently installed version by default. 

So, again, installing the newer version is the only upgrade step needed.

A version greater than the one you have now:
>>easy_install "SomePackage>2.0"

Using the upgrade flag, to find the latest available version on PyPI:
>>easy_install --upgrade SomePackage

Or by using a download page, direct download URL, or package filename:
>>easy_install -f http://example.com/downloads ExamplePackage
>>easy_install 	  http://example.com/downloads/ExamplePackage-2.0-py2.4.egg
>>easy_install my_downloads/ExamplePackage-2.0.tgz

Changing the Active Version


If you've upgraded a package, but need to revert to a previously-installed
version, you can do so like this:

>>easy_install PackageName==1.2.3 
(where 1.2.3 is replaced by the exact version number you wish to switch to. 

If a package matching the requested name and version is not already installed in
a directory on sys.path, it will be located via PyPI and installed.)

To switch to the latest installed version of PackageName:
>>easy_install PackageName

This will activate the latest installed version!

Uninstalling Packages


If you have replaced a package with another version, then you can just delete
the package(s) you don't need by deleting the PackageName-versioninfo.egg file
or directory (found in the installation directory).

If you want to delete the currently installed version of a package 
(or all versions of a package), you should first run:
>>easy_install -mxN PackageName

This will ensure that Python doesn't continue to search for a package you're 
planning to remove. 

After you've done this, you can safely delete the .egg files or directories,
along with any scripts you wish to remove.

For more information on how to use easy_install:
http://peak.telecommunity.com/DevCenter/EasyInstall

Recommended Python Training

For Python training, our top recommendation is DataCamp.

Free Trial

Filed Under: Basics Date Originally Published: October 5, 2012

More Python Topics

API Argv Basics Beautiful Soup bitly Cheatsheet Code Code Snippets Command Line Comments Control Flow crawler Data Types Development Dictionary Dictionary Data Structure In Python Errorhandling Error Handling Exceptions Fabric Files ftplib Games GUI Json Lists Loops Mechanzie Modules Modules In Python Mysql OS pil pip Python Python On The Web Python Strings Requests Scraping Scripts sh Strings System & OS urllib2 Web

Primary Sidebar

Get Our Free Guide To Learning Python

Menu

  • Python Basics
  • Code Examples
  • Loops
  • Functions
  • Strings
  • Python on the Web
  • Lists
  • Dictionaries
  • Python Modules
  • Python Glossary
  • Learn Python

Most Popular Content

  • Reading and Writing Files in Python
  • String Concatenation and Formatting
  • List Comprehensions in Python
  • How to use sys.argv in Python
  • How to use Split in Python
  • How to use comments in Python
  • Python Syntax Basics

Recent Posts

  • Iterating over dictionary in Python
  • Difference between comments and docstrings in Python
  • Shortcut to comment out multiple lines in Python
  • Convert a list containing float numbers to string in Python
  • Single Line and Multi Line Comments in Python

Python Courses

  • Datacamp: Intro To Python
  • 2021 Complete Python Bootcamp
  • Python Mega Course: Build 10 Real World Apps
  • Python Data Science Bootcamp
  • Complete Python Developer: Zero to Mastery

Copyright © 2012–2021 ยท PythonForBeginners.com

  • Home
  • Contact Us
  • Privacy Policy
  • Write For Us