Skip to main content

Easily download, build, install, upgrade, and uninstall Python packages

Project description

Installing and Using Distribute


About the fork

Distribute is a fork of the Setuptools project.

Distribute is intended to replace Setuptools as the standard method for working with Python module distributions.

The fork has two goals:

  • Providing a backward compatible version to replace Setuptools and make all distributions that depend on Setuptools work as before, but with less bugs and behaviorial issues.

    This work is done in the 0.6.x series.

    Starting with version 0.6.2, Distribute supports Python 3. Installing and using distribute for Python 3 code works exactly the same as for Python 2 code, but Distribute also helps you to support Python 2 and Python 3 from the same source code by letting you run 2to3 on the code as a part of the build process, by setting the keyword parameter use_2to3 to True. See for more information.

  • Refactoring the code, and releasing it in several distributions. This work is being done in the 0.7.x series but not yet released.

The roadmap is still evolving, and the page that is up-to-date is located at :

If you install Distribute and want to switch back for any reason to Setuptools, get to the Uninstallation instructions section.

More documentation

You can get more information in the Sphinx-based documentation, located at This documentation includes the old Setuptools documentation that is slowly replaced, and brand new content.

About the installation process

The Distribute installer modifies your installation by de-activating an existing installation of Setuptools in a bootstrap process. This process has been tested in various installation schemes and contexts but in case of a bug during this process your Python installation might be left in a broken state. Since all modified files and directories are copied before the installation starts, you will be able to get back to a normal state by reading the instructions in the Uninstallation instructions section.

In any case, it is recommended to save you site-packages directory before you start the installation of Distribute.

Installation Instructions

Distribute is only released as a source distribution.

It can be installed using easy_install or pip, and can be done so with the source tarball, the eggs distribution, or by using the script provided online. is the simplest and preferred way on all systems.

Download and execute it, using the Python interpreter of your choice.

If your shell has the curl program you can do:

$ curl -O
$ python

Notice this file is also provided in the source release.

easy_install or pip

Run easy_install or pip:

$ easy_install -U distribute
$ pip install distribute

If you want to install the latest dev version, you can also run:

$ easy_install -U distribute==dev

This will get the latest development version at:

Source installation

Download the source tarball, uncompress it, then run the install command:

$ curl -O
$ tar -xzvf distribute-0.6.9.tar.gz
$ cd distribute-0.6.9
$ python install

Uninstallation Instructions

Like other distutils-based distributions, Distribute doesn’t provide an uninstaller yet. It’s all done manually! We are all waiting for PEP 376 support in Python.

Distribute is installed in three steps:

  1. it gets out of the way an existing installation of Setuptools

  2. it installs a fake setuptools installation

  3. it installs distribute

Distribute can be removed like this:

  • run easy_install -m Distribute. This will remove the Distribute reference from easy-install.pth. Otherwise, edit the file and remove it yourself.

  • remove the distribute*.egg file located in your site-packages directory

  • remove the setuptools.pth file located in you site-packages directory

  • remove the easy_install script located in you sys.prefix/bin directory

  • remove the setuptools*.egg directory located in your site-packages directory, if any.

If you want to get back to setuptools:

  • reinstall setuptools using its instruction.


  • remove the .OLD. directory located in your site-packages directory if any, once you have checked everything was working correctly again.

Quick help for developers

To create an egg which is compatible with Distribute, use the same practice as with Setuptools, e.g.:

from setuptools import setup


To use pkg_resources to access data files in the egg, you should require the Setuptools distribution explicitly:

from setuptools import setup


Only if you need Distribute-specific functionality should you depend on it explicitly. In this case, replace the Setuptools dependency:

from setuptools import setup


Install FAQ

  • Why is Distribute wrapping my Setuptools installation?

    Since Distribute is a fork, and since it provides the same package and modules, it renames the existing Setuptools egg and inserts a new one which merely wraps the Distribute code. This way, full backwards compatibility is kept for packages which rely on the Setuptools modules.

    At the same time, packages can meet their dependency on Setuptools without actually installing it (which would disable Distribute).

  • How does Distribute interact with virtualenv?

    Everytime you create a virtualenv it will install setuptools by default. You either need to re-install Distribute in it right after or pass the --distribute option when creating it.

    Once installed, your virtualenv will use Distribute transparently.

    Although, if you have Setuptools installed in your system-wide Python, and if the virtualenv you are in was generated without the –no-site-packages option, the Distribute installation will stop.

    You need in this case to build a virtualenv with the –no-site-packages option or to install Distribute globally.

  • How does Distribute interacts with zc.buildout?

    You can use Distribute in your zc.buildout, with the –distribute option, starting at zc.buildout 1.4.2:

    $ python --distribute

    For previous zc.buildout versions, the only thing you need to do is use the bootstrap at Run that bootstrap and bin/buildout (and all other buildout-generated scripts) will transparently use distribute instead of setuptools. You do not need a specific buildout release.

    A shared eggs directory is no problem (since 0.6.6): the setuptools egg is left in place unmodified. So other buildouts that do not yet use the new bootstrap continue to work just fine. And there is no need to list distribute somewhere in your eggs: using the bootstrap is enough.

    The source code for the bootstrap script is located at

Feedback and getting involved



  • Issue 90: unknown setuptools version can be added in the working set

  • Issue 87: doesn’t try to convert anymore Initial Patch by arfrever.

  • Issue 89: added a side bar with a download link to the doc.

  • Issue 86: fixed missing sentence in pkg_resources doc.

  • Added a nicer error message when a DistributionNotFound is raised.

  • Issue 80: test_develop now works with Python 3.1

  • Issue 93: upload_docs now works if there is an empty sub-directory.

  • Issue 70: exec bit on non-exec files

  • Issue 99: now the standalone easy_install command doesn’t uses a “setup.cfg” if any exists in the working directory. It will use it only if triggered by install_requires from a call (install, develop, etc).

  • Issue 101: Allowing os.devnull in Sandbox

  • Issue 92: Fixed the “no eggs” found error with MacPort (platform.mac_ver() fails)

  • Issue 103: test_get_script_header_jython_workaround not run anymore under py3 with C or POSIX local. Contributed by Arfrever.

  • Issue 104: remvoved the assertion when the installation fails, with a nicer message for the end user.

  • Issue 100: making sure there’s no SandboxViolation when the setup script patches setuptools.


  • Added “check_packages” in dist. (added in Setuptools 0.6c11)

  • Fixed the DONT_PATCH_SETUPTOOLS state.


  • Issue 58: Added –user support to the develop command

  • Issue 11: Generated scripts now wrap their call to the script entry point in the standard “if name == ‘main’”

  • Added the ‘DONT_PATCH_SETUPTOOLS’ environment variable, so virtualenv can drive an installation that doesn’t patch a global setuptools.

  • Reviewed unladen-swallow specific change from and determined that it no longer applies. Distribute should work fine with Unladen Swallow 2009Q3.

  • Issue 21: Allow PackageIndex.open_url to gracefully handle all cases of a httplib.HTTPException instead of just InvalidURL and BadStatusLine.

  • Removed from this distribution and updated documentation to point to the actively maintained virtualenv instead.

  • Issue 64: use_setuptools no longer rebuilds the distribute egg every time it is run

  • use_setuptools now properly respects the requested version

  • use_setuptools will no longer try to import a distribute egg for the wrong Python version

  • Issue 74: no_fake should be True by default.

  • Issue 72: avoid a bootstrapping issue with easy_install -U


  • Unified the bootstrap file so it works on both py2.x and py3k without 2to3 (patch by Holger Krekel)


  • Issue 65: cli.exe and gui.exe are now generated at build time, depending on the platform in use.

  • Issue 67: Fixed doc typo (PEP 381/382)

  • Distribute no longer shadows setuptools if we require a 0.7-series setuptools. And an error is raised when installing a 0.7 setuptools with distribute.

  • When run from within buildout, no attempt is made to modify an existing setuptools egg, whether in a shared egg directory or a system setuptools.

  • Fixed a hole in sandboxing allowing builtin file to write outside of the sandbox.




  • Fixed a bunch of calls to file() that caused crashes on Python 3.


  • Fixed a bug in sorting that caused bootstrap to fail on Python 3.











Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions (425.0 kB view hashes)

Uploaded Source

distribute-0.6.9.tar.gz (389.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page