blob: 779e923d945a0f8fab8348de3b47a712a7d13fb4 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001.. highlightlang:: none
2
3.. _install-index:
4
5*****************************
Georg Brandl48310cd2009-01-03 21:18:54 +00006 Installing Python Modules
Georg Brandl116aa622007-08-15 14:28:22 +00007*****************************
8
9:Author: Greg Ward
Georg Brandl116aa622007-08-15 14:28:22 +000010
Christian Heimes5b5e81c2007-12-31 16:14:33 +000011.. TODO: Fill in XXX comments
Georg Brandl116aa622007-08-15 14:28:22 +000012
Christian Heimes5b5e81c2007-12-31 16:14:33 +000013.. The audience for this document includes people who don't know anything
14 about Python and aren't about to learn the language just in order to
15 install and maintain it for their users, i.e. system administrators.
16 Thus, I have to be sure to explain the basics at some point:
17 sys.path and PYTHONPATH at least. Should probably give pointers to
18 other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc.
Georg Brandl48310cd2009-01-03 21:18:54 +000019
Christian Heimes5b5e81c2007-12-31 16:14:33 +000020 Finally, it might be useful to include all the material from my "Care
21 and Feeding of a Python Installation" talk in here somewhere. Yow!
Georg Brandl116aa622007-08-15 14:28:22 +000022
Nick Coghlanb5c4fd02013-12-10 21:24:55 +100023This document describes the Python Distribution Utilities ("Distutils") from the
24end-user's point-of-view, describing how to extend the capabilities of a
25standard Python installation by building and installing third-party Python
26modules and extensions.
Georg Brandl116aa622007-08-15 14:28:22 +000027
Nick Coghlanb5c4fd02013-12-10 21:24:55 +100028
29.. note::
30
31 This guide only covers the basic tools for installing extensions that are
32 provided as part of this version of Python. Third party tools offer easier
33 to use and more secure alternatives. Refer to the
34 `quick recommendations section
35 <https://python-packaging-user-guide.readthedocs.org/en/latest/current.html>`__
36 in the Python Packaging User Guide for more information.
Georg Brandl116aa622007-08-15 14:28:22 +000037
38
39.. _inst-intro:
40
41Introduction
42============
43
44Although Python's extensive standard library covers many programming needs,
45there often comes a time when you need to add some new functionality to your
46Python installation in the form of third-party modules. This might be necessary
47to support your own programming, or to support an application that you want to
48use and that happens to be written in Python.
49
50In the past, there has been little support for adding third-party modules to an
51existing Python installation. With the introduction of the Python Distribution
52Utilities (Distutils for short) in Python 2.0, this changed.
53
54This document is aimed primarily at the people who need to install third-party
55Python modules: end-users and system administrators who just need to get some
56Python application running, and existing Python programmers who want to add some
57new goodies to their toolbox. You don't need to know Python to read this
58document; there will be some brief forays into using Python's interactive mode
59to explore your installation, but that's it. If you're looking for information
60on how to distribute your own Python modules so that others may use them, see
61the :ref:`distutils-index` manual.
62
63
64.. _inst-trivial-install:
65
66Best case: trivial installation
67-------------------------------
68
69In the best case, someone will have prepared a special version of the module
70distribution you want to install that is targeted specifically at your platform
71and is installed just like any other software on your platform. For example,
72the module developer might make an executable installer available for Windows
73users, an RPM package for users of RPM-based Linux systems (Red Hat, SuSE,
74Mandrake, and many others), a Debian package for users of Debian-based Linux
75systems, and so forth.
76
77In that case, you would download the installer appropriate to your platform and
78do the obvious thing with it: run it if it's an executable installer, ``rpm
79--install`` it if it's an RPM, etc. You don't need to run Python or a setup
80script, you don't need to compile anything---you might not even need to read any
Éric Araujo59e387e2011-07-26 16:53:17 +020081instructions (although it's always a good idea to do so anyway).
Georg Brandl116aa622007-08-15 14:28:22 +000082
83Of course, things will not always be that easy. You might be interested in a
84module distribution that doesn't have an easy-to-use installer for your
85platform. In that case, you'll have to start with the source distribution
86released by the module's author/maintainer. Installing from a source
87distribution is not too hard, as long as the modules are packaged in the
88standard way. The bulk of this document is about building and installing
89modules from standard source distributions.
90
91
92.. _inst-new-standard:
93
94The new standard: Distutils
95---------------------------
96
97If you download a module source distribution, you can tell pretty quickly if it
98was packaged and distributed in the standard way, i.e. using the Distutils.
99First, the distribution's name and version number will be featured prominently
100in the name of the downloaded archive, e.g. :file:`foo-1.0.tar.gz` or
101:file:`widget-0.9.7.zip`. Next, the archive will unpack into a similarly-named
102directory: :file:`foo-1.0` or :file:`widget-0.9.7`. Additionally, the
103distribution will contain a setup script :file:`setup.py`, and a file named
104:file:`README.txt` or possibly just :file:`README`, which should explain that
Éric Araujob805c472011-06-08 01:11:36 +0200105building and installing the module distribution is a simple matter of running
106one command from a terminal::
Georg Brandl116aa622007-08-15 14:28:22 +0000107
108 python setup.py install
109
Éric Araujo355d48a2011-08-19 09:28:46 +0200110For Windows, this command should be run from a command prompt window
Éric Araujoa2d26182011-08-19 03:12:38 +0200111(:menuselection:`Start --> Accessories`)::
Éric Araujob805c472011-06-08 01:11:36 +0200112
113 setup.py install
114
Georg Brandl116aa622007-08-15 14:28:22 +0000115If all these things are true, then you already know how to build and install the
116modules you've just downloaded: Run the command above. Unless you need to
117install things in a non-standard way or customize the build process, you don't
118really need this manual. Or rather, the above command is everything you need to
119get out of this manual.
120
121
122.. _inst-standard-install:
123
124Standard Build and Install
125==========================
126
127As described in section :ref:`inst-new-standard`, building and installing a module
Éric Araujob805c472011-06-08 01:11:36 +0200128distribution using the Distutils is usually one simple command to run from a
129terminal::
Georg Brandl116aa622007-08-15 14:28:22 +0000130
131 python setup.py install
132
Georg Brandl116aa622007-08-15 14:28:22 +0000133
134.. _inst-platform-variations:
135
136Platform variations
137-------------------
138
139You should always run the setup command from the distribution root directory,
140i.e. the top-level subdirectory that the module source distribution unpacks
141into. For example, if you've just downloaded a module source distribution
142:file:`foo-1.0.tar.gz` onto a Unix system, the normal thing to do is::
143
144 gunzip -c foo-1.0.tar.gz | tar xf - # unpacks into directory foo-1.0
145 cd foo-1.0
146 python setup.py install
147
148On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
149archive file to :file:`C:\\Temp`, then it would unpack into
150:file:`C:\\Temp\\foo-1.0`; you can use either a archive manipulator with a
151graphical user interface (such as WinZip) or a command-line tool (such as
152:program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a
Éric Araujoa2d26182011-08-19 03:12:38 +0200153command prompt window and run::
Georg Brandl116aa622007-08-15 14:28:22 +0000154
155 cd c:\Temp\foo-1.0
156 python setup.py install
157
158
159.. _inst-splitting-up:
160
161Splitting the job up
162--------------------
163
164Running ``setup.py install`` builds and installs all modules in one run. If you
165prefer to work incrementally---especially useful if you want to customize the
166build process, or if things are going wrong---you can use the setup script to do
167one thing at a time. This is particularly helpful when the build and install
168will be done by different users---for example, you might want to build a module
169distribution and hand it off to a system administrator for installation (or do
170it yourself, with super-user privileges).
171
172For example, you can build everything in one step, and then install everything
173in a second step, by invoking the setup script twice::
174
175 python setup.py build
176 python setup.py install
177
178If you do this, you will notice that running the :command:`install` command
179first runs the :command:`build` command, which---in this case---quickly notices
180that it has nothing to do, since everything in the :file:`build` directory is
181up-to-date.
182
183You may not need this ability to break things down often if all you do is
184install modules downloaded off the 'net, but it's very handy for more advanced
185tasks. If you get into distributing your own Python modules and extensions,
186you'll run lots of individual Distutils commands on their own.
187
188
189.. _inst-how-build-works:
190
191How building works
192------------------
193
194As implied above, the :command:`build` command is responsible for putting the
195files to install into a *build directory*. By default, this is :file:`build`
196under the distribution root; if you're excessively concerned with speed, or want
197to keep the source tree pristine, you can change the build directory with the
198:option:`--build-base` option. For example::
199
Petri Lehtinen9f74c6c2013-02-23 19:26:56 +0100200 python setup.py build --build-base=/path/to/pybuild/foo-1.0
Georg Brandl116aa622007-08-15 14:28:22 +0000201
202(Or you could do this permanently with a directive in your system or personal
203Distutils configuration file; see section :ref:`inst-config-files`.) Normally, this
204isn't necessary.
205
206The default layout for the build tree is as follows::
207
208 --- build/ --- lib/
209 or
210 --- build/ --- lib.<plat>/
211 temp.<plat>/
212
213where ``<plat>`` expands to a brief description of the current OS/hardware
214platform and Python version. The first form, with just a :file:`lib` directory,
215is used for "pure module distributions"---that is, module distributions that
216include only pure Python modules. If a module distribution contains any
217extensions (modules written in C/C++), then the second form, with two ``<plat>``
218directories, is used. In that case, the :file:`temp.{plat}` directory holds
219temporary files generated by the compile/link process that don't actually get
220installed. In either case, the :file:`lib` (or :file:`lib.{plat}`) directory
221contains all Python modules (pure Python and extensions) that will be installed.
222
223In the future, more directories will be added to handle Python scripts,
224documentation, binary executables, and whatever else is needed to handle the job
225of installing Python modules and applications.
226
227
228.. _inst-how-install-works:
229
230How installation works
231----------------------
232
233After the :command:`build` command runs (whether you run it explicitly, or the
234:command:`install` command does it for you), the work of the :command:`install`
235command is relatively simple: all it has to do is copy everything under
236:file:`build/lib` (or :file:`build/lib.{plat}`) to your chosen installation
237directory.
238
239If you don't choose an installation directory---i.e., if you just run ``setup.py
240install``\ ---then the :command:`install` command installs to the standard
241location for third-party Python modules. This location varies by platform and
242by how you built/installed Python itself. On Unix (and Mac OS X, which is also
243Unix-based), it also depends on whether the module distribution being installed
244is pure Python or contains extensions ("non-pure"):
245
Georg Brandl44ea77b2013-03-28 13:28:44 +0100246.. tabularcolumns:: |l|l|l|l|
247
Georg Brandl116aa622007-08-15 14:28:22 +0000248+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
249| Platform | Standard installation location | Default value | Notes |
250+=================+=====================================================+==================================================+=======+
251| Unix (pure) | :file:`{prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1) |
252+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
253| Unix (non-pure) | :file:`{exec-prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1) |
254+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
Brian Curtin308053e2011-05-03 21:57:00 -0500255| Windows | :file:`{prefix}\\Lib\\site-packages` | :file:`C:\\Python{XY}\\Lib\\site-packages` | \(2) |
Georg Brandl116aa622007-08-15 14:28:22 +0000256+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
257
258Notes:
259
260(1)
261 Most Linux distributions include Python as a standard part of the system, so
262 :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` on
263 Linux. If you build Python yourself on Linux (or any Unix-like system), the
264 default :file:`{prefix}` and :file:`{exec-prefix}` are :file:`/usr/local`.
265
266(2)
267 The default installation directory on Windows was :file:`C:\\Program
268 Files\\Python` under Python 1.6a1, 1.5.2, and earlier.
269
270:file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that Python
271is installed to, and where it finds its libraries at run-time. They are always
272the same under Windows, and very often the same under Unix and Mac OS X. You
273can find out what your Python installation uses for :file:`{prefix}` and
274:file:`{exec-prefix}` by running Python in interactive mode and typing a few
275simple commands. Under Unix, just type ``python`` at the shell prompt. Under
276Windows, choose :menuselection:`Start --> Programs --> Python X.Y -->
277Python (command line)`. Once the interpreter is started, you type Python code
278at the prompt. For example, on my Linux system, I type the three Python
279statements shown below, and get the output as shown, to find out my
280:file:`{prefix}` and :file:`{exec-prefix}`::
281
Georg Brandl48310cd2009-01-03 21:18:54 +0000282 Python 2.4 (#26, Aug 7 2004, 17:19:02)
Georg Brandl116aa622007-08-15 14:28:22 +0000283 Type "help", "copyright", "credits" or "license" for more information.
284 >>> import sys
285 >>> sys.prefix
286 '/usr'
287 >>> sys.exec_prefix
288 '/usr'
289
Éric Araujo6ef038e2011-08-06 16:30:42 +0200290A few other placeholders are used in this document: :file:`{X.Y}` stands for the
291version of Python, for example ``3.2``; :file:`{abiflags}` will be replaced by
292the value of :data:`sys.abiflags` or the empty string for platforms which don't
293define ABI flags; :file:`{distname}` will be replaced by the name of the module
294distribution being installed. Dots and capitalization are important in the
295paths; for example, a value that uses ``python3.2`` on UNIX will typically use
296``Python32`` on Windows.
297
Georg Brandl116aa622007-08-15 14:28:22 +0000298If you don't want to install modules to the standard location, or if you don't
299have permission to write there, then you need to read about alternate
300installations in section :ref:`inst-alt-install`. If you want to customize your
301installation directories more heavily, see section :ref:`inst-custom-install` on
302custom installations.
303
304
305.. _inst-alt-install:
306
307Alternate Installation
308======================
309
310Often, it is necessary or desirable to install modules to a location other than
311the standard location for third-party Python modules. For example, on a Unix
312system you might not have permission to write to the standard third-party module
313directory. Or you might wish to try out a module before making it a standard
314part of your local Python installation. This is especially true when upgrading
315a distribution already present: you want to make sure your existing base of
316scripts still works with the new version before actually upgrading.
317
318The Distutils :command:`install` command is designed to make installing module
319distributions to an alternate location simple and painless. The basic idea is
320that you supply a base directory for the installation, and the
321:command:`install` command picks a set of directories (called an *installation
322scheme*) under this base directory in which to install files. The details
323differ across platforms, so read whichever of the following sections applies to
324you.
325
Éric Araujo6ef038e2011-08-06 16:30:42 +0200326Note that the various alternate installation schemes are mutually exclusive: you
327can pass ``--user``, or ``--home``, or ``--prefix`` and ``--exec-prefix``, or
328``--install-base`` and ``--install-platbase``, but you can't mix from these
329groups.
Georg Brandl116aa622007-08-15 14:28:22 +0000330
Éric Araujo6ef038e2011-08-06 16:30:42 +0200331
332.. _inst-alt-install-user:
333
334Alternate installation: the user scheme
335---------------------------------------
336
337This scheme is designed to be the most convenient solution for users that don't
338have write permission to the global site-packages directory or don't want to
339install into it. It is enabled with a simple option::
340
341 python setup.py install --user
342
343Files will be installed into subdirectories of :data:`site.USER_BASE` (written
344as :file:`{userbase}` hereafter). This scheme installs pure Python modules and
345extension modules in the same location (also known as :data:`site.USER_SITE`).
346Here are the values for UNIX, including Mac OS X:
347
348=============== ===========================================================
349Type of file Installation directory
350=============== ===========================================================
351modules :file:`{userbase}/lib/python{X.Y}/site-packages`
352scripts :file:`{userbase}/bin`
353data :file:`{userbase}`
354C headers :file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`
355=============== ===========================================================
356
357And here are the values used on Windows:
358
359=============== ===========================================================
360Type of file Installation directory
361=============== ===========================================================
362modules :file:`{userbase}\\Python{XY}\\site-packages`
363scripts :file:`{userbase}\\Scripts`
364data :file:`{userbase}`
365C headers :file:`{userbase}\\Python{XY}\\Include\\{distname}`
366=============== ===========================================================
367
368The advantage of using this scheme compared to the other ones described below is
369that the user site-packages directory is under normal conditions always included
370in :data:`sys.path` (see :mod:`site` for more information), which means that
371there is no additional step to perform after running the :file:`setup.py` script
372to finalize the installation.
373
374The :command:`build_ext` command also has a ``--user`` option to add
375:file:`{userbase}/include` to the compiler search path for header files and
376:file:`{userbase}/lib` to the compiler search path for libraries as well as to
377the runtime search path for shared C libraries (rpath).
378
379
380.. _inst-alt-install-home:
Georg Brandl116aa622007-08-15 14:28:22 +0000381
382Alternate installation: the home scheme
383---------------------------------------
384
385The idea behind the "home scheme" is that you build and maintain a personal
386stash of Python modules. This scheme's name is derived from the idea of a
387"home" directory on Unix, since it's not unusual for a Unix user to make their
388home directory have a layout similar to :file:`/usr/` or :file:`/usr/local/`.
Georg Brandlf6914aa2010-07-26 15:11:49 +0000389This scheme can be used by anyone, regardless of the operating system they
390are installing for.
Georg Brandl116aa622007-08-15 14:28:22 +0000391
392Installing a new module distribution is as simple as ::
393
394 python setup.py install --home=<dir>
395
396where you can supply any directory you like for the :option:`--home` option. On
397Unix, lazy typists can just type a tilde (``~``); the :command:`install` command
398will expand this to your home directory::
399
400 python setup.py install --home=~
401
Éric Araujo6ef038e2011-08-06 16:30:42 +0200402To make Python find the distributions installed with this scheme, you may have
403to :ref:`modify Python's search path <inst-search-path>` or edit
404:mod:`sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit
405:data:`sys.path`.
406
Georg Brandl116aa622007-08-15 14:28:22 +0000407The :option:`--home` option defines the installation base directory. Files are
408installed to the following directories under the installation base as follows:
409
Éric Araujo6ef038e2011-08-06 16:30:42 +0200410=============== ===========================================================
411Type of file Installation directory
412=============== ===========================================================
413modules :file:`{home}/lib/python`
414scripts :file:`{home}/bin`
415data :file:`{home}`
416C headers :file:`{home}/include/python/{distname}`
417=============== ===========================================================
418
419(Mentally replace slashes with backslashes if you're on Windows.)
Georg Brandl116aa622007-08-15 14:28:22 +0000420
Georg Brandl116aa622007-08-15 14:28:22 +0000421
Éric Araujo6ef038e2011-08-06 16:30:42 +0200422.. _inst-alt-install-prefix-unix:
Georg Brandl116aa622007-08-15 14:28:22 +0000423
424Alternate installation: Unix (the prefix scheme)
425------------------------------------------------
426
427The "prefix scheme" is useful when you wish to use one Python installation to
428perform the build/install (i.e., to run the setup script), but install modules
429into the third-party module directory of a different Python installation (or
430something that looks like a different Python installation). If this sounds a
Éric Araujo6ef038e2011-08-06 16:30:42 +0200431trifle unusual, it is---that's why the user and home schemes come before. However,
Georg Brandl116aa622007-08-15 14:28:22 +0000432there are at least two known cases where the prefix scheme will be useful.
433
434First, consider that many Linux distributions put Python in :file:`/usr`, rather
435than the more traditional :file:`/usr/local`. This is entirely appropriate,
436since in those cases Python is part of "the system" rather than a local add-on.
437However, if you are installing Python modules from source, you probably want
438them to go in :file:`/usr/local/lib/python2.{X}` rather than
439:file:`/usr/lib/python2.{X}`. This can be done with ::
440
441 /usr/bin/python setup.py install --prefix=/usr/local
442
443Another possibility is a network filesystem where the name used to write to a
444remote directory is different from the name used to read it: for example, the
445Python interpreter accessed as :file:`/usr/local/bin/python` might search for
446modules in :file:`/usr/local/lib/python2.{X}`, but those modules would have to
447be installed to, say, :file:`/mnt/{@server}/export/lib/python2.{X}`. This could
448be done with ::
449
450 /usr/local/bin/python setup.py install --prefix=/mnt/@server/export
451
452In either case, the :option:`--prefix` option defines the installation base, and
453the :option:`--exec-prefix` option defines the platform-specific installation
454base, which is used for platform-specific files. (Currently, this just means
455non-pure module distributions, but could be expanded to C libraries, binary
456executables, etc.) If :option:`--exec-prefix` is not supplied, it defaults to
457:option:`--prefix`. Files are installed as follows:
458
Éric Araujo6ef038e2011-08-06 16:30:42 +0200459================= ==========================================================
460Type of file Installation directory
461================= ==========================================================
462Python modules :file:`{prefix}/lib/python{X.Y}/site-packages`
463extension modules :file:`{exec-prefix}/lib/python{X.Y}/site-packages`
464scripts :file:`{prefix}/bin`
465data :file:`{prefix}`
466C headers :file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`
467================= ==========================================================
Georg Brandl116aa622007-08-15 14:28:22 +0000468
469There is no requirement that :option:`--prefix` or :option:`--exec-prefix`
470actually point to an alternate Python installation; if the directories listed
471above do not already exist, they are created at installation time.
472
473Incidentally, the real reason the prefix scheme is important is simply that a
474standard Unix installation uses the prefix scheme, but with :option:`--prefix`
475and :option:`--exec-prefix` supplied by Python itself as ``sys.prefix`` and
476``sys.exec_prefix``. Thus, you might think you'll never use the prefix scheme,
477but every time you run ``python setup.py install`` without any other options,
478you're using it.
479
480Note that installing extensions to an alternate Python installation has no
481effect on how those extensions are built: in particular, the Python header files
482(:file:`Python.h` and friends) installed with the Python interpreter used to run
483the setup script will be used in compiling extensions. It is your
484responsibility to ensure that the interpreter used to run extensions installed
485in this way is compatible with the interpreter used to build them. The best way
486to do this is to ensure that the two interpreters are the same version of Python
487(possibly different builds, or possibly copies of the same build). (Of course,
488if your :option:`--prefix` and :option:`--exec-prefix` don't even point to an
489alternate Python installation, this is immaterial.)
490
491
Éric Araujo6ef038e2011-08-06 16:30:42 +0200492.. _inst-alt-install-prefix-windows:
Georg Brandl116aa622007-08-15 14:28:22 +0000493
494Alternate installation: Windows (the prefix scheme)
495---------------------------------------------------
496
497Windows has no concept of a user's home directory, and since the standard Python
498installation under Windows is simpler than under Unix, the :option:`--prefix`
499option has traditionally been used to install additional packages in separate
500locations on Windows. ::
501
502 python setup.py install --prefix="\Temp\Python"
503
504to install modules to the :file:`\\Temp\\Python` directory on the current drive.
505
506The installation base is defined by the :option:`--prefix` option; the
Éric Araujo6ef038e2011-08-06 16:30:42 +0200507:option:`--exec-prefix` option is not supported under Windows, which means that
508pure Python modules and extension modules are installed into the same location.
509Files are installed as follows:
Georg Brandl116aa622007-08-15 14:28:22 +0000510
Éric Araujo6ef038e2011-08-06 16:30:42 +0200511=============== ==========================================================
512Type of file Installation directory
513=============== ==========================================================
514modules :file:`{prefix}\\Lib\\site-packages`
515scripts :file:`{prefix}\\Scripts`
516data :file:`{prefix}`
517C headers :file:`{prefix}\\Include\\{distname}`
518=============== ==========================================================
Georg Brandl116aa622007-08-15 14:28:22 +0000519
520
521.. _inst-custom-install:
522
523Custom Installation
524===================
525
526Sometimes, the alternate installation schemes described in section
527:ref:`inst-alt-install` just don't do what you want. You might want to tweak just
528one or two directories while keeping everything under the same base directory,
529or you might want to completely redefine the installation scheme. In either
530case, you're creating a *custom installation scheme*.
531
Éric Araujo6ef038e2011-08-06 16:30:42 +0200532To create a custom installation scheme, you start with one of the alternate
533schemes and override some of the installation directories used for the various
534types of files, using these options:
535
536====================== =======================
537Type of file Override option
538====================== =======================
539Python modules ``--install-purelib``
540extension modules ``--install-platlib``
541all modules ``--install-lib``
542scripts ``--install-scripts``
543data ``--install-data``
544C headers ``--install-headers``
545====================== =======================
546
547These override options can be relative, absolute,
Georg Brandl116aa622007-08-15 14:28:22 +0000548or explicitly defined in terms of one of the installation base directories.
549(There are two installation base directories, and they are normally the same---
550they only differ when you use the Unix "prefix scheme" and supply different
Éric Araujo6ef038e2011-08-06 16:30:42 +0200551``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will
552override values computed or given for ``--install-purelib`` and
553``--install-platlib``, and is recommended for schemes that don't make a
554difference between Python and extension modules.)
Georg Brandl116aa622007-08-15 14:28:22 +0000555
556For example, say you're installing a module distribution to your home directory
557under Unix---but you want scripts to go in :file:`~/scripts` rather than
558:file:`~/bin`. As you might expect, you can override this directory with the
559:option:`--install-scripts` option; in this case, it makes most sense to supply
560a relative path, which will be interpreted relative to the installation base
561directory (your home directory, in this case)::
562
563 python setup.py install --home=~ --install-scripts=scripts
564
565Another Unix example: suppose your Python installation was built and installed
566with a prefix of :file:`/usr/local/python`, so under a standard installation
567scripts will wind up in :file:`/usr/local/python/bin`. If you want them in
568:file:`/usr/local/bin` instead, you would supply this absolute directory for the
569:option:`--install-scripts` option::
570
571 python setup.py install --install-scripts=/usr/local/bin
572
573(This performs an installation using the "prefix scheme," where the prefix is
574whatever your Python interpreter was installed with--- :file:`/usr/local/python`
575in this case.)
576
577If you maintain Python on Windows, you might want third-party modules to live in
578a subdirectory of :file:`{prefix}`, rather than right in :file:`{prefix}`
579itself. This is almost as easy as customizing the script installation directory
580---you just have to remember that there are two types of modules to worry about,
Éric Araujo6ef038e2011-08-06 16:30:42 +0200581Python and extension modules, which can conveniently be both controlled by one
582option::
Georg Brandl116aa622007-08-15 14:28:22 +0000583
Éric Araujo6ef038e2011-08-06 16:30:42 +0200584 python setup.py install --install-lib=Site
Georg Brandl116aa622007-08-15 14:28:22 +0000585
Éric Araujo6ef038e2011-08-06 16:30:42 +0200586The specified installation directory is relative to :file:`{prefix}`. Of
587course, you also have to ensure that this directory is in Python's module
588search path, such as by putting a :file:`.pth` file in a site directory (see
589:mod:`site`). See section :ref:`inst-search-path` to find out how to modify
590Python's search path.
Georg Brandl116aa622007-08-15 14:28:22 +0000591
592If you want to define an entire installation scheme, you just have to supply all
593of the installation directory options. The recommended way to do this is to
594supply relative paths; for example, if you want to maintain all Python
595module-related files under :file:`python` in your home directory, and you want a
596separate directory for each platform that you use your home directory from, you
597might define the following installation scheme::
598
599 python setup.py install --home=~ \
600 --install-purelib=python/lib \
601 --install-platlib=python/lib.$PLAT \
602 --install-scripts=python/scripts
603 --install-data=python/data
604
Georg Brandl81ac1ce2007-08-31 17:17:17 +0000605or, equivalently, ::
Georg Brandl116aa622007-08-15 14:28:22 +0000606
607 python setup.py install --home=~/python \
608 --install-purelib=lib \
609 --install-platlib='lib.$PLAT' \
610 --install-scripts=scripts
611 --install-data=data
612
613``$PLAT`` is not (necessarily) an environment variable---it will be expanded by
614the Distutils as it parses your command line options, just as it does when
615parsing your configuration file(s).
616
Georg Brandl116aa622007-08-15 14:28:22 +0000617Obviously, specifying the entire installation scheme every time you install a
618new module distribution would be very tedious. Thus, you can put these options
619into your Distutils config file (see section :ref:`inst-config-files`)::
620
621 [install]
622 install-base=$HOME
623 install-purelib=python/lib
624 install-platlib=python/lib.$PLAT
625 install-scripts=python/scripts
626 install-data=python/data
627
628or, equivalently, ::
629
630 [install]
631 install-base=$HOME/python
632 install-purelib=lib
633 install-platlib=lib.$PLAT
634 install-scripts=scripts
635 install-data=data
636
637Note that these two are *not* equivalent if you supply a different installation
638base directory when you run the setup script. For example, ::
639
640 python setup.py install --install-base=/tmp
641
Éric Araujo6ef038e2011-08-06 16:30:42 +0200642would install pure modules to :file:`/tmp/python/lib` in the first case, and
643to :file:`/tmp/lib` in the second case. (For the second case, you probably
Georg Brandl116aa622007-08-15 14:28:22 +0000644want to supply an installation base of :file:`/tmp/python`.)
645
646You probably noticed the use of ``$HOME`` and ``$PLAT`` in the sample
647configuration file input. These are Distutils configuration variables, which
648bear a strong resemblance to environment variables. In fact, you can use
649environment variables in config files on platforms that have such a notion but
650the Distutils additionally define a few extra variables that may not be in your
651environment, such as ``$PLAT``. (And of course, on systems that don't have
652environment variables, such as Mac OS 9, the configuration variables supplied by
653the Distutils are the only ones you can use.) See section :ref:`inst-config-files`
654for details.
655
Georg Brandl521ed522013-05-12 12:36:07 +0200656.. note:: When a :ref:`virtual environment <venv-def>` is activated, any options
657 that change the installation path will be ignored from all distutils configuration
658 files to prevent inadvertently installing projects outside of the virtual
659 environment.
660
Christian Heimes5b5e81c2007-12-31 16:14:33 +0000661.. XXX need some Windows examples---when would custom installation schemes be
662 needed on those platforms?
Georg Brandl116aa622007-08-15 14:28:22 +0000663
Georg Brandl116aa622007-08-15 14:28:22 +0000664
Éric Araujo6ef038e2011-08-06 16:30:42 +0200665.. XXX Move this to Doc/using
Georg Brandl116aa622007-08-15 14:28:22 +0000666
667.. _inst-search-path:
668
669Modifying Python's Search Path
670------------------------------
671
672When the Python interpreter executes an :keyword:`import` statement, it searches
673for both Python code and extension modules along a search path. A default value
674for the path is configured into the Python binary when the interpreter is built.
675You can determine the path by importing the :mod:`sys` module and printing the
676value of ``sys.path``. ::
677
678 $ python
679 Python 2.2 (#11, Oct 3 2002, 13:31:27)
680 [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
Georg Brandl1f01deb2009-01-03 22:47:39 +0000681 Type "help", "copyright", "credits" or "license" for more information.
Georg Brandl116aa622007-08-15 14:28:22 +0000682 >>> import sys
683 >>> sys.path
Georg Brandl48310cd2009-01-03 21:18:54 +0000684 ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2',
685 '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload',
Georg Brandl116aa622007-08-15 14:28:22 +0000686 '/usr/local/lib/python2.3/site-packages']
687 >>>
688
689The null string in ``sys.path`` represents the current working directory.
690
Georg Brandl116aa622007-08-15 14:28:22 +0000691The expected convention for locally installed packages is to put them in the
692:file:`{...}/site-packages/` directory, but you may want to install Python
693modules into some arbitrary directory. For example, your site may have a
694convention of keeping all software related to the web server under :file:`/www`.
695Add-on Python modules might then belong in :file:`/www/python`, and in order to
696import them, this directory must be added to ``sys.path``. There are several
697different ways to add the directory.
698
699The most convenient way is to add a path configuration file to a directory
700that's already on Python's path, usually to the :file:`.../site-packages/`
701directory. Path configuration files have an extension of :file:`.pth`, and each
702line must contain a single path that will be appended to ``sys.path``. (Because
703the new paths are appended to ``sys.path``, modules in the added directories
704will not override standard modules. This means you can't use this mechanism for
705installing fixed versions of standard modules.)
706
707Paths can be absolute or relative, in which case they're relative to the
Christian Heimes9cd17752007-11-18 19:35:23 +0000708directory containing the :file:`.pth` file. See the documentation of
Thomas Woutersed03b412007-08-28 21:37:11 +0000709the :mod:`site` module for more information.
Georg Brandl116aa622007-08-15 14:28:22 +0000710
711A slightly less convenient way is to edit the :file:`site.py` file in Python's
712standard library, and modify ``sys.path``. :file:`site.py` is automatically
713imported when the Python interpreter is executed, unless the :option:`-S` switch
714is supplied to suppress this behaviour. So you could simply edit
715:file:`site.py` and add two lines to it::
716
717 import sys
718 sys.path.append('/www/python/')
719
720However, if you reinstall the same major version of Python (perhaps when
721upgrading from 2.2 to 2.2.2, for example) :file:`site.py` will be overwritten by
722the stock version. You'd have to remember that it was modified and save a copy
723before doing the installation.
724
725There are two environment variables that can modify ``sys.path``.
726:envvar:`PYTHONHOME` sets an alternate value for the prefix of the Python
727installation. For example, if :envvar:`PYTHONHOME` is set to ``/www/python``,
728the search path will be set to ``['', '/www/python/lib/pythonX.Y/',
729'/www/python/lib/pythonX.Y/plat-linux2', ...]``.
730
731The :envvar:`PYTHONPATH` variable can be set to a list of paths that will be
732added to the beginning of ``sys.path``. For example, if :envvar:`PYTHONPATH` is
733set to ``/www/python:/opt/py``, the search path will begin with
734``['/www/python', '/opt/py']``. (Note that directories must exist in order to
735be added to ``sys.path``; the :mod:`site` module removes paths that don't
736exist.)
737
738Finally, ``sys.path`` is just a regular Python list, so any Python application
739can modify it by adding or removing entries.
740
741
742.. _inst-config-files:
743
744Distutils Configuration Files
745=============================
746
747As mentioned above, you can use Distutils configuration files to record personal
748or site preferences for any Distutils options. That is, any option to any
749command can be stored in one of two or three (depending on your platform)
750configuration files, which will be consulted before the command-line is parsed.
751This means that configuration files will override default values, and the
752command-line will in turn override configuration files. Furthermore, if
753multiple configuration files apply, values from "earlier" files are overridden
754by "later" files.
755
756
757.. _inst-config-filenames:
758
759Location and names of config files
760----------------------------------
761
762The names and locations of the configuration files vary slightly across
763platforms. On Unix and Mac OS X, the three configuration files (in the order
764they are processed) are:
765
766+--------------+----------------------------------------------------------+-------+
767| Type of file | Location and filename | Notes |
768+==============+==========================================================+=======+
769| system | :file:`{prefix}/lib/python{ver}/distutils/distutils.cfg` | \(1) |
770+--------------+----------------------------------------------------------+-------+
771| personal | :file:`$HOME/.pydistutils.cfg` | \(2) |
772+--------------+----------------------------------------------------------+-------+
773| local | :file:`setup.cfg` | \(3) |
774+--------------+----------------------------------------------------------+-------+
775
776And on Windows, the configuration files are:
777
778+--------------+-------------------------------------------------+-------+
779| Type of file | Location and filename | Notes |
780+==============+=================================================+=======+
781| system | :file:`{prefix}\\Lib\\distutils\\distutils.cfg` | \(4) |
782+--------------+-------------------------------------------------+-------+
783| personal | :file:`%HOME%\\pydistutils.cfg` | \(5) |
784+--------------+-------------------------------------------------+-------+
785| local | :file:`setup.cfg` | \(3) |
786+--------------+-------------------------------------------------+-------+
787
Tarek Ziadéc7c71ff2009-10-27 23:12:01 +0000788On all platforms, the "personal" file can be temporarily disabled by
789passing the `--no-user-cfg` option.
790
Georg Brandl116aa622007-08-15 14:28:22 +0000791Notes:
792
793(1)
794 Strictly speaking, the system-wide configuration file lives in the directory
795 where the Distutils are installed; under Python 1.6 and later on Unix, this is
796 as shown. For Python 1.5.2, the Distutils will normally be installed to
797 :file:`{prefix}/lib/python1.5/site-packages/distutils`, so the system
798 configuration file should be put there under Python 1.5.2.
799
800(2)
801 On Unix, if the :envvar:`HOME` environment variable is not defined, the user's
802 home directory will be determined with the :func:`getpwuid` function from the
Tarek Ziadéf3b33222009-08-21 14:22:45 +0000803 standard :mod:`pwd` module. This is done by the :func:`os.path.expanduser`
804 function used by Distutils.
Georg Brandl116aa622007-08-15 14:28:22 +0000805
806(3)
807 I.e., in the current directory (usually the location of the setup script).
808
809(4)
810 (See also note (1).) Under Python 1.6 and later, Python's default "installation
811 prefix" is :file:`C:\\Python`, so the system configuration file is normally
812 :file:`C:\\Python\\Lib\\distutils\\distutils.cfg`. Under Python 1.5.2, the
813 default prefix was :file:`C:\\Program Files\\Python`, and the Distutils were not
814 part of the standard library---so the system configuration file would be
815 :file:`C:\\Program Files\\Python\\distutils\\distutils.cfg` in a standard Python
816 1.5.2 installation under Windows.
817
818(5)
Tarek Ziadéf3b33222009-08-21 14:22:45 +0000819 On Windows, if the :envvar:`HOME` environment variable is not defined,
820 :envvar:`USERPROFILE` then :envvar:`HOMEDRIVE` and :envvar:`HOMEPATH` will
821 be tried. This is done by the :func:`os.path.expanduser` function used
822 by Distutils.
Georg Brandl116aa622007-08-15 14:28:22 +0000823
824
825.. _inst-config-syntax:
826
827Syntax of config files
828----------------------
829
830The Distutils configuration files all have the same syntax. The config files
831are grouped into sections. There is one section for each Distutils command,
832plus a ``global`` section for global options that affect every command. Each
833section consists of one option per line, specified as ``option=value``.
834
835For example, the following is a complete config file that just forces all
836commands to run quietly by default::
837
838 [global]
839 verbose=0
840
841If this is installed as the system config file, it will affect all processing of
842any Python module distribution by any user on the current system. If it is
843installed as your personal config file (on systems that support them), it will
844affect only module distributions processed by you. And if it is used as the
845:file:`setup.cfg` for a particular module distribution, it affects only that
846distribution.
847
848You could override the default "build base" directory and make the
849:command:`build\*` commands always forcibly rebuild all files with the
850following::
851
852 [build]
853 build-base=blib
854 force=1
855
856which corresponds to the command-line arguments ::
857
858 python setup.py build --build-base=blib --force
859
860except that including the :command:`build` command on the command-line means
861that command will be run. Including a particular command in config files has no
862such implication; it only means that if the command is run, the options in the
863config file will apply. (Or if other commands that derive values from it are
864run, they will use the values in the config file.)
865
866You can find out the complete list of options for any command using the
867:option:`--help` option, e.g.::
868
869 python setup.py build --help
870
871and you can find out the complete list of global options by using
872:option:`--help` without a command::
873
874 python setup.py --help
875
876See also the "Reference" section of the "Distributing Python Modules" manual.
877
878
879.. _inst-building-ext:
880
881Building Extensions: Tips and Tricks
882====================================
883
884Whenever possible, the Distutils try to use the configuration information made
885available by the Python interpreter used to run the :file:`setup.py` script.
886For example, the same compiler and linker flags used to compile Python will also
887be used for compiling extensions. Usually this will work well, but in
888complicated situations this might be inappropriate. This section discusses how
889to override the usual Distutils behaviour.
890
891
892.. _inst-tweak-flags:
893
894Tweaking compiler/linker flags
895------------------------------
896
897Compiling a Python extension written in C or C++ will sometimes require
898specifying custom flags for the compiler and linker in order to use a particular
899library or produce a special kind of object code. This is especially true if the
900extension hasn't been tested on your platform, or if you're trying to
901cross-compile Python.
902
903In the most general case, the extension author might have foreseen that
904compiling the extensions would be complicated, and provided a :file:`Setup` file
905for you to edit. This will likely only be done if the module distribution
906contains many separate extension modules, or if they often require elaborate
907sets of compiler flags in order to work.
908
909A :file:`Setup` file, if present, is parsed in order to get a list of extensions
910to build. Each line in a :file:`Setup` describes a single module. Lines have
911the following structure::
912
913 module ... [sourcefile ...] [cpparg ...] [library ...]
914
915
916Let's examine each of the fields in turn.
917
918* *module* is the name of the extension module to be built, and should be a
919 valid Python identifier. You can't just change this in order to rename a module
920 (edits to the source code would also be needed), so this should be left alone.
921
922* *sourcefile* is anything that's likely to be a source code file, at least
923 judging by the filename. Filenames ending in :file:`.c` are assumed to be
924 written in C, filenames ending in :file:`.C`, :file:`.cc`, and :file:`.c++` are
925 assumed to be C++, and filenames ending in :file:`.m` or :file:`.mm` are assumed
926 to be in Objective C.
927
928* *cpparg* is an argument for the C preprocessor, and is anything starting with
929 :option:`-I`, :option:`-D`, :option:`-U` or :option:`-C`.
930
931* *library* is anything ending in :file:`.a` or beginning with :option:`-l` or
932 :option:`-L`.
933
934If a particular platform requires a special library on your platform, you can
935add it by editing the :file:`Setup` file and running ``python setup.py build``.
936For example, if the module defined by the line ::
937
938 foo foomodule.c
939
940must be linked with the math library :file:`libm.a` on your platform, simply add
941:option:`-lm` to the line::
942
943 foo foomodule.c -lm
944
945Arbitrary switches intended for the compiler or the linker can be supplied with
946the :option:`-Xcompiler` *arg* and :option:`-Xlinker` *arg* options::
947
948 foo foomodule.c -Xcompiler -o32 -Xlinker -shared -lm
949
950The next option after :option:`-Xcompiler` and :option:`-Xlinker` will be
951appended to the proper command line, so in the above example the compiler will
952be passed the :option:`-o32` option, and the linker will be passed
953:option:`-shared`. If a compiler option requires an argument, you'll have to
954supply multiple :option:`-Xcompiler` options; for example, to pass ``-x c++``
955the :file:`Setup` file would have to contain ``-Xcompiler -x -Xcompiler c++``.
956
957Compiler flags can also be supplied through setting the :envvar:`CFLAGS`
958environment variable. If set, the contents of :envvar:`CFLAGS` will be added to
959the compiler flags specified in the :file:`Setup` file.
960
961
962.. _inst-non-ms-compilers:
963
964Using non-Microsoft compilers on Windows
965----------------------------------------
966
967.. sectionauthor:: Rene Liebscher <R.Liebscher@gmx.de>
968
969
970
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000971Borland/CodeGear C++
972^^^^^^^^^^^^^^^^^^^^
Georg Brandl116aa622007-08-15 14:28:22 +0000973
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000974This subsection describes the necessary steps to use Distutils with the Borland
Georg Brandl116aa622007-08-15 14:28:22 +0000975C++ compiler version 5.5. First you have to know that Borland's object file
976format (OMF) is different from the format used by the Python version you can
977download from the Python or ActiveState Web site. (Python is built with
978Microsoft Visual C++, which uses COFF as the object file format.) For this
979reason you have to convert Python's library :file:`python25.lib` into the
980Borland format. You can do this as follows:
981
Christian Heimes5b5e81c2007-12-31 16:14:33 +0000982.. Should we mention that users have to create cfg-files for the compiler?
983.. see also http://community.borland.com/article/0,1410,21205,00.html
Georg Brandl116aa622007-08-15 14:28:22 +0000984
985::
986
987 coff2omf python25.lib python25_bcpp.lib
988
989The :file:`coff2omf` program comes with the Borland compiler. The file
990:file:`python25.lib` is in the :file:`Libs` directory of your Python
991installation. If your extension uses other libraries (zlib, ...) you have to
992convert them too.
993
994The converted files have to reside in the same directories as the normal
995libraries.
996
997How does Distutils manage to use these libraries with their changed names? If
998the extension needs a library (eg. :file:`foo`) Distutils checks first if it
999finds a library with suffix :file:`_bcpp` (eg. :file:`foo_bcpp.lib`) and then
1000uses this library. In the case it doesn't find such a special library it uses
1001the default name (:file:`foo.lib`.) [#]_
1002
1003To let Distutils compile your extension with Borland C++ you now have to type::
1004
1005 python setup.py build --compiler=bcpp
1006
1007If you want to use the Borland C++ compiler as the default, you could specify
1008this in your personal or system-wide configuration file for Distutils (see
1009section :ref:`inst-config-files`.)
1010
1011
1012.. seealso::
1013
Christian Heimesdd15f6c2008-03-16 00:07:10 +00001014 `C++Builder Compiler <http://www.codegear.com/downloads/free/cppbuilder>`_
Georg Brandl116aa622007-08-15 14:28:22 +00001015 Information about the free C++ compiler from Borland, including links to the
1016 download pages.
1017
1018 `Creating Python Extensions Using Borland's Free Compiler <http://www.cyberus.ca/~g_will/pyExtenDL.shtml>`_
1019 Document describing how to use Borland's free command-line C++ compiler to build
1020 Python.
1021
1022
1023GNU C / Cygwin / MinGW
1024^^^^^^^^^^^^^^^^^^^^^^
1025
Georg Brandl116aa622007-08-15 14:28:22 +00001026This section describes the necessary steps to use Distutils with the GNU C/C++
1027compilers in their Cygwin and MinGW distributions. [#]_ For a Python interpreter
1028that was built with Cygwin, everything should work without any of these
1029following steps.
1030
Éric Araujo2d6bb122010-12-15 22:06:35 +00001031Not all extensions can be built with MinGW or Cygwin, but many can. Extensions
1032most likely to not work are those that use C++ or depend on Microsoft Visual C
1033extensions.
1034
1035To let Distutils compile your extension with Cygwin you have to type::
1036
1037 python setup.py build --compiler=cygwin
1038
1039and for Cygwin in no-cygwin mode [#]_ or for MinGW type::
1040
1041 python setup.py build --compiler=mingw32
1042
1043If you want to use any of these options/compilers as default, you should
1044consider writing it in your personal or system-wide configuration file for
1045Distutils (see section :ref:`inst-config-files`.)
1046
1047Older Versions of Python and MinGW
1048""""""""""""""""""""""""""""""""""
1049The following instructions only apply if you're using a version of Python
1050inferior to 2.4.1 with a MinGW inferior to 3.0.0 (with
1051binutils-2.13.90-20030111-1).
1052
1053These compilers require some special libraries. This task is more complex than
Georg Brandl116aa622007-08-15 14:28:22 +00001054for Borland's C++, because there is no program to convert the library. First
1055you have to create a list of symbols which the Python DLL exports. (You can find
Georg Brandl495f7b52009-10-27 15:28:25 +00001056a good program for this task at
Georg Brandl1cef2642013-10-06 13:20:49 +02001057http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/).
Georg Brandl116aa622007-08-15 14:28:22 +00001058
Christian Heimes5b5e81c2007-12-31 16:14:33 +00001059.. I don't understand what the next line means. --amk
1060.. (inclusive the references on data structures.)
Georg Brandl116aa622007-08-15 14:28:22 +00001061
1062::
1063
1064 pexports python25.dll >python25.def
1065
1066The location of an installed :file:`python25.dll` will depend on the
1067installation options and the version and language of Windows. In a "just for
1068me" installation, it will appear in the root of the installation directory. In
1069a shared installation, it will be located in the system directory.
1070
1071Then you can create from these information an import library for gcc. ::
1072
1073 /cygwin/bin/dlltool --dllname python25.dll --def python25.def --output-lib libpython25.a
1074
1075The resulting library has to be placed in the same directory as
1076:file:`python25.lib`. (Should be the :file:`libs` directory under your Python
1077installation directory.)
1078
1079If your extension uses other libraries (zlib,...) you might have to convert
1080them too. The converted files have to reside in the same directories as the
1081normal libraries do.
1082
Georg Brandl116aa622007-08-15 14:28:22 +00001083
1084.. seealso::
1085
1086 `Building Python modules on MS Windows platform with MinGW <http://www.zope.org/Members/als/tips/win32_mingw_modules>`_
1087 Information about building the required libraries for the MinGW environment.
1088
Georg Brandl116aa622007-08-15 14:28:22 +00001089
1090.. rubric:: Footnotes
1091
1092.. [#] This also means you could replace all existing COFF-libraries with OMF-libraries
1093 of the same name.
1094
1095.. [#] Check http://sources.redhat.com/cygwin/ and http://www.mingw.org/ for more
1096 information
1097
1098.. [#] Then you have no POSIX emulation available, but you also don't need
1099 :file:`cygwin1.dll`.