Skip to main content

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

Project description

Installing and Using Setuptools

Installation Instructions

Upgrading from Distribute

Currently, Distribute disallows installing Setuptools 0.7+ over Distribute. You must first uninstall any active version of Distribute first (see Uninstalling).

Upgrading from Setuptools 0.6

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 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.

Unix-based Systems including Mac OS X

Download and run it using the target Python version. The script will download the appropriate version and install it for you:

> wget -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
> python --user

Advanced Installation

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 with any supported distutils and Setuptools options. For example:

setuptools-x.x$ python --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.

Using Setuptools and EasyInstall

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.


  • The original design for the .egg format and the pkg_resources API was co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first version of pkg_resources, and supplied the OS X operating system version compatibility algorithm.

  • Ian Bicking implemented many early “creature comfort” features of easy_install, including support for downloading via Sourceforge and Subversion repositories. Ian’s comments on the Web-SIG about WSGI application deployment also inspired the concept of “entry points” in eggs, and he has given talks at PyCon and elsewhere to inform and educate the community about eggs and setuptools.

  • Jim Fulton contributed time and effort to build automated tests of various aspects of easy_install, and supplied the doctests for the command-line .exe wrappers on Windows.

  • Phillip J. Eby is the principal author and maintainer of setuptools, and first proposed the idea of an importable binary distribution format for Python application plug-ins.

  • Significant parts of the implementation of setuptools were funded by the Open Source Applications Foundation, to provide a plug-in infrastructure for the Chandler PIM application. In addition, many OSAF staffers (such as Mike “Code Bear” Taylor) contributed their time and stress as guinea pigs for the use of eggs and setuptools, even before eggs were “cool”. (Thanks, guys!)



  • Issue #43: Fix issue (introduced in 0.9.1) with version resolution when upgrading over other releases of Setuptools.


  • Issue #42: Fix new AttributeError introduced in last fix.


  • Issue #42: Fix regression where blank checksums would trigger an AttributeError.


  • Distribute #386: Allow other positional and keyword arguments to

  • Corrected dependency on certifi mis-referenced in 0.9.


  • package_index now validates hashes other than MD5 in download links.


  • Code base now runs on Python 2.4 - Python 3.3 without Python 2to3 conversion.





  • Issue #21: Restore Python 2.4 compatibility in test_easy_install.

  • Distribute #375: Merged additional warning from Distribute 0.6.46.



  • Issue #20: Fix comparison of parsed SVN version on Python 3.


  • Issue #1: Disable installation of Windows-specific files on non-Windows systems.

  • Use new sysconfig module with Python 2.7 or >=3.2.


  • Issue #14: Use markerlib when the parser module is not available.

  • Issue #10: now uses HTTPS to download setuptools from PyPI.


  • Fix NameError (Issue #3) again - broken in bad merge.


  • Merged Setuptools and Distribute. See docs/merge.txt for details.

Added several features that were slated for setuptools 0.6c12:

  • Index URL now defaults to HTTPS.

  • Added experimental environment marker support. Now clients may designate a PEP-426 environment marker for “extra” dependencies. Setuptools uses this feature in for optional SSL and certificate validation support on older platforms. Based on Distutils-SIG discussions, the syntax is somewhat tentative. There should probably be a PEP with a firmer spec before the feature should be considered suitable for use.

  • Added support for SSL certificate validation when installing packages from an HTTPS service.


  • Issue #3: Fixed NameError in SSL support.


  • Move warning check in get_cache_path to follow the directory creation to avoid errors when the cache path does not yet exist. Fixes the error reported in Distribute #375.


  • Correct AttributeError in ResourceManager.get_cache_path introduced in 0.6.46 (redo).


  • Correct AttributeError in ResourceManager.get_cache_path introduced in 0.6.46.


  • Distribute #375: Issue a warning if the PYTHON_EGG_CACHE or otherwise customized egg cache location specifies a directory that’s group- or world-writable.


  • Distribute #379: now traps VersionConflict as well, restoring ability to upgrade from an older setuptools version.


  • has been updated to allow Setuptools 0.7 to satisfy use_setuptools.


  • Distribute #378: Restore support for Python 2.4 Syntax (regression in 0.6.42).


  • External links finder no longer yields duplicate links.

  • Distribute #337: Moved to setuptools/ (graft of very old patch from setuptools trunk which inspired PR #31).


  • Distribute #27: Use public api for loading resources from zip files rather than the private method _zip_directory_cache.

  • Added a new function easy_install.get_win_launcher which may be used by third-party libraries such as buildout to get a suitable script launcher.


  • Distribute #376: brought back cli.exe and gui.exe that were deleted in the previous release.


  • Add support for console launchers on ARM platforms.

  • Fix possible issue in GUI launchers where the subsystem was not supplied to the linker.

  • Launcher build script now refactored for robustness.

  • Distribute #375: Resources extracted from a zip egg to the file system now also check the contents of the file against the zip contents during each invocation of get_resource_filename.



  • Distribute #143: Launcher scripts, including easy_install itself, are now accompanied by a manifest on 32-bit Windows environments to avoid the Installer Detection Technology and thus undesirable UAC elevation described in this Microsoft article.


  • Pull Request #35: In Buildout #64, it was reported that under Python 3, installation of distutils scripts could attempt to copy the __pycache__ directory as a file, causing an error, apparently only under Windows. Easy_install now skips all directories when processing metadata scripts.


Note this release is backward-incompatible with distribute 0.6.23-0.6.34 in how it parses version numbers.

  • Distribute #278: Restored compatibility with distribute 0.6.22 and setuptools 0.6. Updated the documentation to match more closely with the version parsing as intended in setuptools 0.6.



  • Fix 2 errors with Jython 2.5.

  • Fix 1 failure with Jython 2.5 and 2.7.

  • Disable workaround for Jython scripts on Linux systems.

  • Distribute #336: no longer masks failure exit code when tests fail.

  • Fix issue in pkg_resources where try/except around a platform-dependent import would trigger hook load failures on Mercurial. See pull request 32 for details.

  • Distribute #341: Fix a ResourceWarning.


  • Fix test suite with Python 2.6.

  • Fix some DeprecationWarnings and ResourceWarnings.

  • Distribute #335: Backed out setup_requires superceding installed requirements until regression can be addressed.


  • 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.


  • Distribute #328: Clean up temporary directories in

  • Fix fatal bug in


  • Pull Request #14: Honor file permissions in zip files.

  • Distribute #327: Merged pull request #24 to fix a dependency problem with pip.

  • Merged pull request #23 to fix

  • If Sphinx is installed, the upload_docs command now runs build_sphinx to produce uploadable documentation.

  • Distribute #326: upload_docs provided mangled auth credentials under Python 3.

  • Distribute #320: Fix check for “createable” in

  • Distribute #305: Remove a warning that was triggered during normal operations.

  • Distribute #311: Print metadata in UTF-8 independent of platform.

  • Distribute #303: Read manifest file with UTF-8 encoding under Python 3.

  • Distribute #301: Allow to run tests of namespace packages when using 2to3.

  • Distribute #304: Prevent import loop in under Python 3.3.

  • Distribute #283: Reenable scanning of *.pyc / *.pyo files on Python 3.3.

  • Distribute #299: The develop command didn’t work on Python 3, when using 2to3, as the egg link would go to the Python 2 source. Linking to the 2to3’d code in build/lib makes it work, although you will have to rebuild the module before testing it.

  • Distribute #306: Even if 2to3 is used, we build in-place under Python 2.

  • Distribute #307: Prints the full path when .svn/entries is broken.

  • Distribute #313: Support for sdist subcommands (Python 2.7)

  • Distribute #314: test_local_index() would fail an OS X.

  • Distribute #310: Non-ascii characters in a namespace causes errors.

  • Distribute #218: Improved documentation on behavior of package_data and include_package_data. Files indicated by package_data are now included in the manifest.

  • now allows a –download-base argument for retrieving distribute from a specified location.


  • Distribute #294: can now be invoked from any directory.

  • Scripts are now installed honoring the umask.

  • Added support for .dist-info directories.

  • Distribute #283: Fix and disable scanning of *.pyc / *.pyo files on Python 3.3.


  • Support current snapshots of CPython 3.3.

  • Distribute now recognizes README.rst as a standard, default readme file.

  • Exclude ‘encodings’ modules when removing modules from sys.modules. Workaround for #285.

  • Distribute #231: Don’t fiddle with system python when used with buildout (


  • Distribute #183: Symlinked files are now extracted from source distributions.

  • Distribute #227: Easy_install fetch parameters are now passed during the installation of a source distribution; now fulfillment of setup_requires dependencies will honor the parameters passed to easy_install.


  • Distribute #258: Workaround a cache issue

  • Distribute #260: now accepts the –user parameter for Python 2.6 and later.

  • Distribute #262: package_index.open_with_auth no longer throws LookupError on Python 3.

  • Distribute #269: AttributeError when an exception occurs reading on late releases of Python.

  • Distribute #272: Prevent TypeError when namespace package names are unicode and single-install-externally-managed is used. Also fixes PIP issue 449.

  • Distribute #273: Legacy script launchers now install with Python2/3 support.






  • Distribute #206: AttributeError: ‘HTTPMessage’ object has no attribute ‘getheaders’



  • Support ‘DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT’ environment variable to allow to disable installation of easy_install-${version} script.

  • Support Python >=3.1.4 and >=3.2.1.

  • Distribute #204: Don’t try to import the parent of a namespace package in declare_namespace

  • Distribute #196: Tolerate responses with multiple Content-Length headers

  • Distribute #205: Sandboxing doesn’t preserve working_set. Leads to setup_requires problems.



  • Fixed typo in bdist_egg

  • Several issues under Python 3 has been solved.

  • Distribute #146: Fixed missing DLL files after easy_install of windows exe package.


  • Distribute #170: Fixed unittest failure. Thanks to Toshio.

  • Distribute #171: Fixed race condition in unittests cause deadlocks in test suite.

  • Distribute #143: Fixed a lookup issue with easy_install. Thanks to David and Zooko.

  • Distribute #174: Fixed the edit mode when its used with setuptools itself


  • Distribute #160: 2.7 gives ValueError(“Invalid IPv6 URL”)

  • Distribute #150: Fixed using ~/.local even in a –no-site-packages virtualenv

  • Distribute #163: scan index links before external links, and don’t use the md5 when comparing two distributions



  • Found another case of SandboxViolation - fixed

  • Distribute #15 and Distribute #48: Introduced a socket timeout of 15 seconds on url openings

  • Added indexsidebar.html into

  • Distribute #108: Fixed TypeError with Python3.1

  • Distribute #121: Fixed –help install command trying to actually install.

  • Distribute #112: Added an os.makedirs so that Tarek’s solution will work.

  • Distribute #133: Added –no-find-links to easy_install

  • Added easy_install –user

  • Distribute #100: Fixed develop –user not taking ‘.’ in PYTHONPATH into account

  • Distribute #134: removed spurious UserWarnings. Patch by VanLindberg

  • Distribute #138: cant_write_to_target error when setup_requires is used.

  • Distribute #147: respect the sys.dont_write_bytecode flag


  • Reverted change made for the DistributionNotFound exception because zc.buildout uses the exception message to get the name of the distribution.


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

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

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

  • Distribute #86: fixed missing sentence in pkg_resources doc.

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

  • Distribute #80: test_develop now works with Python 3.1

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

  • Distribute #70: exec bit on non-exec files

  • Distribute #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).

  • Distribute #101: Allowing os.devnull in Sandbox

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

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

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

  • Distribute #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.


  • Distribute #58: Added –user support to the develop command

  • Distribute #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.

  • Distribute #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.

  • Distribute #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

  • Distribute #74: no_fake should be True by default.

  • Distribute #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)


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

  • Distribute #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.


  • Added the generation of during the release. This closes Distribute #52.

  • Added an upload_docs command to easily upload project documentation to PyPI’s This close issue Distribute #56.

  • Fixed a bootstrap bug on the use_setuptools() API.



  • 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.




  • Fixed bootstrap not working on Windows. This closes issue Distribute #49.

  • Fixed 2.6 dependencies. This closes issue Distribute #50.

  • Make sure setuptools is patched when running through easy_install This closes Old Setuptools #40.



  • package_index.urlopen now catches BadStatusLine and malformed url errors. This closes Distribute #16 and Distribute #18.

  • zip_ok is now False by default. This closes Old Setuptools #33.

  • Fixed invalid URL error catching. Old Setuptools #20.

  • Fixed invalid bootstraping with easy_install installation (Distribute #40). Thanks to Florian Schulze for the help.

  • Removed buildout/ A new repository will create a specific script.


  • The boostrap process leave setuptools alone if detected in the system and –root or –prefix is provided, but is not in the same location. This closes Distribute #10.



  • Packages required at build time where not fully present at install time. This closes Distribute #12.

  • Protected against failures in tarfile extraction. This closes Distribute #10.

  • Made Jython api_tests.txt doctest compatible. This closes Distribute #7.

  • replaced builtin type file with builtin function open. This closes Distribute #6.

  • Immediately close all file handles. This closes Distribute #3.

  • Added compatibility with Subversion 1.6. This references Distribute #1.


  • Avoid a call to /usr/bin/sw_vers on OSX and use the official platform API instead. Based on a patch from ronaldoussoren. This closes issue #5.

  • Fixed a SandboxViolation for mkdir that could occur in certain cases. This closes Distribute #13.

  • Allow to find_on_path on systems with tight permissions to fail gracefully. This closes Distribute #9.

  • Corrected inconsistency between documentation and code of add_entry. This closes Distribute #8.

  • Immediately close all file handles. This closes Distribute #3.


Project details

Release history Release notifications | RSS feed

Download files

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

Source Distributions (822.8 kB view hashes)

Uploaded Source

setuptools-0.9.4.tar.gz (764.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