17
17
Installation Instructions
18
18
-------------------------
20
Upgrading from Distribute
21
=========================
23
Currently, Distribute disallows installing Setuptools 0.7+ over Distribute.
24
You must first uninstall any active version of Distribute first (see
27
Upgrading from Setuptools 0.6
28
=============================
30
Upgrading from prior versions of Setuptools is supported. Initial reports
31
good success in this regard.
20
The recommended way to bootstrap setuptools on any system is to download
21
`ez_setup.py`_ and run it using the target Python environment. Different
22
operating systems have different recommended techniques to accomplish this
23
basic routine, so below are some examples to get you started.
25
Setuptools requires Python 2.6 or later. To install setuptools
26
on Python 2.4 or Python 2.5, use the `bootstrap script for Setuptools 1.x
27
<https://bitbucket.org/pypa/setuptools/raw/bootstrap-py24/ez_setup.py>`_.
29
The link provided to ez_setup.py is a bookmark to bootstrap script for the
30
latest known stable release.
32
.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
34
Windows 8 (Powershell)
35
======================
37
For best results, uninstall previous versions FIRST (see `Uninstalling`_).
39
Using Windows 8 or later, it's possible to install with one simple Powershell
40
command. Start up Powershell and paste this command::
42
> (Invoke-WebRequest https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py).Content | python -
44
You must start the Powershell with Administrative privileges or you may choose
45
to install a user-local installation::
47
> (Invoke-WebRequest https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py).Content | python - --user
49
If you have Python 3.3 or later, you can use the ``py`` command to install to
50
different Python versions. For example, to install to Python 3.3 if you have
51
Python 2.7 installed::
53
> (Invoke-WebRequest https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py).Content | py -3 -
36
55
The recommended way to install setuptools on Windows is to download
37
56
`ez_setup.py`_ and run it. The script will download the appropriate .egg
38
57
file and install it for you.
40
.. _ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
42
For best results, uninstall previous versions FIRST (see `Uninstalling`_).
44
59
Once installation is complete, you will find an ``easy_install`` program in
45
60
your Python ``Scripts`` subdirectory. For simple invocation and best results,
46
61
add this directory to your ``PATH`` environment variable, if it is not already
50
Unix-based Systems including Mac OS X
51
=====================================
62
present. If you did a user-local install, the ``Scripts`` subdirectory is
63
``$env:APPDATA\Python\Scripts``.
66
Windows 7 (or graphical install)
67
================================
69
For Windows 7 and earlier, download `ez_setup.py`_ using your favorite web
70
browser or other technique and "run" that file.
76
Most Linux distributions come with wget.
53
78
Download `ez_setup.py`_ and run it using the target Python version. The script
54
79
will download the appropriate version and install it for you::
61
86
> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python
63
Alternatively, on Python 2.6 and later, Setuptools may be installed to a
66
> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
67
> python ez_setup.py --user
70
Python 2.4 and Python 2.5 support
71
=================================
73
Setuptools 2.0 and later requires Python 2.6 or later. To install setuptools
74
on Python 2.4 or Python 2.5, use the bootstrap script for Setuptools 1.x:
75
https://bitbucket.org/pypa/setuptools/raw/bootstrap-py24/ez_setup.py.
88
Alternatively, Setuptools may be installed to a user-local path::
90
> wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python - --user
92
Unix including Mac OS X (curl)
93
==============================
95
If your system has curl installed, follow the ``wget`` instructions but
96
replace ``wget`` with ``curl`` and ``-O`` with ``-o``. For example::
98
> curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -o - | python
78
101
Advanced Installation
229
* Add ``include`` parameter to ``setuptools.find_packages()``.
235
* `Pull Request #39 <https://bitbucket.org/pypa/setuptools/pull-request/39>`_: Add support for C++ targets from Cython ``.pyx`` files.
236
* `Issue #162 <https://bitbucket.org/pypa/setuptools/issue/162>`_: Update dependency on certifi to 1.0.1.
237
* `Issue #164 <https://bitbucket.org/pypa/setuptools/issue/164>`_: Update dependency on wincertstore to 0.2.
243
* `Issue #161 <https://bitbucket.org/pypa/setuptools/issue/161>`_: Restore Features functionality to allow backward compatibility
244
(for Features) until the uses of that functionality is sufficiently removed.
250
* Correct typo in previous bugfix.
256
* `Issue #157 <https://bitbucket.org/pypa/setuptools/issue/157>`_: Restore support for Python 2.6 in bootstrap script where
257
``zipfile.ZipFile`` does not yet have support for context managers.
263
* `Issue #125 <https://bitbucket.org/pypa/setuptools/issue/125>`_: Prevent Subversion support from creating a ~/.subversion
264
directory just for checking the presence of a Subversion repository.
265
* `Issue #12 <https://bitbucket.org/pypa/setuptools/issue/12>`_: Namespace packages are now imported lazily. That is, the mere
266
declaration of a namespace package in an egg on ``sys.path`` no longer
267
causes it to be imported when ``pkg_resources`` is imported. Note that this
268
change means that all of a namespace package's ``__init__.py`` files must
269
include a ``declare_namespace()`` call in order to ensure that they will be
270
handled properly at runtime. In 2.x it was possible to get away without
271
including the declaration, but only at the cost of forcing namespace
272
packages to be imported early, which 3.0 no longer does.
273
* `Issue #148 <https://bitbucket.org/pypa/setuptools/issue/148>`_: When building (bdist_egg), setuptools no longer adds
274
``__init__.py`` files to namespace packages. Any packages that rely on this
275
behavior will need to create ``__init__.py`` files and include the
276
``declare_namespace()``.
277
* `Issue #7 <https://bitbucket.org/pypa/setuptools/issue/7>`_: Setuptools itself is now distributed as a zip archive in addition to
278
tar archive. ez_setup.py now uses zip archive. This approach avoids the potential
279
security vulnerabilities presented by use of tar archives in ez_setup.py.
280
It also leverages the security features added to ZipFile.extract in Python 2.7.4.
281
* `Issue #65 <https://bitbucket.org/pypa/setuptools/issue/65>`_: Removed deprecated Features functionality.
282
* `Pull Request #28 <https://bitbucket.org/pypa/setuptools/pull-request/28>`_: Remove backport of ``_bytecode_filenames`` which is
283
available in Python 2.6 and later, but also has better compatibility with
284
Python 3 environments.
285
* `Issue #156 <https://bitbucket.org/pypa/setuptools/issue/156>`_: Fix spelling of __PYVENV_LAUNCHER__ variable.