Easily download, build, install, upgrade, and uninstall Python packages
Table of Contents
Currently, Distribute disallows installing Setuptools 0.7+ over Distribute. You must first uninstall any active version of Distribute first (see Uninstalling).
Upgrading from prior versions of Setuptools is supported. Initial reports good success in this regard.
The recommended way to install setuptools on Windows is to download ez_setup.py and run it. The script will download the appropriate .egg file and install it for you.
For best results, uninstall previous versions FIRST (see Uninstalling).
Once installation is complete, you will find an easy_install.exe program in your Python Scripts subdirectory. For simple invocation and best results, add this directory to your PATH environment variable, if it is not already present.
Download ez_setup.py and run it using the target Python version. The script will download the appropriate version and install it for you:
> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
Note that you will may need to invoke the command with superuser privileges to install to the system Python.
Alternatively, on Python 2.6 and later, Setuptools may be installed to a user-local path:
> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py > python ez_setup.py --user
For more advanced installation options, such as installing to custom locations or prefixes, download and extract the source tarball from Setuptools on PyPI and run setup.py with any supported distutils and Setuptools options. For example:
setuptools-x.x$ python setup.py --prefix=/opt/setuptools
Use --help to get a full options list, but we recommend consulting the EasyInstall manual for detailed instructions, especially the section on custom installation locations.
All setuptools downloads can be found at the project's home page in the Python Package Index. Scroll to the very bottom of the page to find the links.
In addition to the PyPI downloads, the development version of setuptools is available from the Bitbucket repo, and in-development versions of the 0.6 branch are available as well.
On Windows, if Setuptools was installed using an .exe or .msi installer, simply use the uninstall feature of "Add/Remove Programs" in the Control Panel.
Otherwise, to uninstall Setuptools or Distribute, regardless of the Python version, delete all setuptools* and distribute* files and directories from your system's site-packages directory (and any other sys.path directories) FIRST.
If you are upgrading or otherwise plan to re-install Setuptools or Distribute, nothing further needs to be done. If you want to completely remove Setuptools, you may also want to remove the 'easy_install' and 'easy_install-x.x' scripts and associated executables installed to the Python scripts directory.
Here are some of the available manuals, tutorials, and other resources for learning about Setuptools, Python Eggs, and EasyInstall:
Questions, comments, and bug reports should be directed to the distutils-sig mailing list. If you have written (or know of) any tutorials, documentation, plug-ins, or other resources for setuptools users, please let us know about them there, so this reference list can be updated. If you have working, tested patches to correct problems or add features, you may submit them to the setuptools bug tracker.
Added several features that were slated for setuptools 0.6c12:
Note this release is backward-incompatible with distribute 0.6.23-0.6.34 in how it parses version numbers.
Distribute #303: Make sure the manifest only ever contains UTF-8 in Python 3.
Distribute #329: Properly close files created by tests for compatibility with Jython.
Work around Jython #1980 and Jython #1981.
Distribute #334: Provide workaround for packages that reference sys.__stdout__ such as numpy does. This change should address virtualenv #359 as long as the system encoding is UTF-8 or the IO encoding is specified in the environment, i.e.:
PYTHONIOENCODING=utf8 pip install numpy
Fix for encoding issue when installing from Windows executable on Python 3.
Distribute #323: Allow setup_requires requirements to supercede installed requirements. Added some new keyword arguments to existing pkg_resources methods. Also had to updated how __path__ is handled for namespace packages to ensure that when a new egg distribution containing a namespace package is placed on sys.path, the entries in __path__ are found in the same order they would have been in had that egg been on the path when pkg_resources was first imported.