Lines Matching +full:- +full:- +full:dllname
3 .. _install-index:
15 :ref:`installing-index`
29 end-user's point-of-view, describing how to extend the capabilities of a
30 standard Python installation by building and installing third-party Python
43 .. _inst-intro:
51 Python installation in the form of third-party modules. This might be necessary
55 In the past, there has been little support for adding third-party modules to an
59 This document is aimed primarily at the people who need to install third-party
60 Python modules: end-users and system administrators who just need to get some
66 the :ref:`distutils-index` manual. :ref:`debug-setup-script` may also be of
71 .. _inst-trivial-install:
74 -------------------------------
80 users, an RPM package for users of RPM-based Linux systems (Red Hat, SuSE,
81 Mandrake, and many others), a Debian package for users of Debian-based Linux
86 --install`` it if it's an RPM, etc. You don't need to run Python or a setup
87 script, you don't need to compile anything---you might not even need to read any
91 module distribution that doesn't have an easy-to-use installer for your
99 .. _inst-new-standard:
102 ---------------------------
107 in the name of the downloaded archive, e.g. :file:`foo-1.0.tar.gz` or
108 :file:`widget-0.9.7.zip`. Next, the archive will unpack into a similarly-named
109 directory: :file:`foo-1.0` or :file:`widget-0.9.7`. Additionally, the
118 (:menuselection:`Start --> Accessories`)::
124 install things in a non-standard way or customize the build process, you don't
129 .. _inst-standard-install:
134 As described in section :ref:`inst-new-standard`, building and installing a module
141 .. _inst-platform-variations:
144 -------------------
147 i.e. the top-level subdirectory that the module source distribution unpacks
149 :file:`foo-1.0.tar.gz` onto a Unix system, the normal thing to do is::
151 gunzip -c foo-1.0.tar.gz | tar xf - # unpacks into directory foo-1.0
152 cd foo-1.0
155 On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
157 :file:`C:\\Temp\\foo-1.0`; you can use either an archive manipulator with a
158 graphical user interface (such as WinZip) or a command-line tool (such as
162 cd c:\Temp\foo-1.0
166 .. _inst-splitting-up:
169 --------------------
172 prefer to work incrementally---especially useful if you want to customize the
173 build process, or if things are going wrong---you can use the setup script to do
175 will be done by different users---for example, you might want to build a module
177 it yourself, with super-user privileges).
186 first runs the :command:`build` command, which---in this case---quickly notices
188 up-to-date.
196 .. _inst-how-build-works:
199 ------------------
205 :option:`!--build-base` option. For example::
207 python setup.py build --build-base=/path/to/pybuild/foo-1.0
210 Distutils configuration file; see section :ref:`inst-config-files`.) Normally, this
215 --- build/ --- lib/
217 --- build/ --- lib.<plat>/
222 is used for "pure module distributions"---that is, module distributions that
235 .. _inst-how-install-works:
238 ----------------------
246 If you don't choose an installation directory---i.e., if you just run ``setup.py
247 install``\ ---then the :command:`install` command installs to the standard
248 location for third-party Python modules. This location varies by platform and
250 Unix-based), it also depends on whether the module distribution being installed
251 is pure Python or contains extensions ("non-pure"):
255 +-----------------+-----------------------------------------------------+--------------------------…
258 …pure) | :file:`{prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y…
259 +-----------------+-----------------------------------------------------+--------------------------…
260 | Unix (non-pure) | :file:`{exec-prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/pyt…
261 +-----------------+-----------------------------------------------------+--------------------------…
262 | Windows | :file:`{prefix}\\Lib\\site-packages` | :file:`C:\\Python{XY}\\Li…
263 +-----------------+-----------------------------------------------------+--------------------------…
269 :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` on
270 Linux. If you build Python yourself on Linux (or any Unix-like system), the
271 default :file:`{prefix}` and :file:`{exec-prefix}` are :file:`/usr/local`.
277 :file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that Python
278 is installed to, and where it finds its libraries at run-time. They are always
281 :file:`{exec-prefix}` by running Python in interactive mode and typing a few
283 Windows, choose :menuselection:`Start --> Programs --> Python X.Y -->
287 :file:`{prefix}` and :file:`{exec-prefix}`::
305 installations in section :ref:`inst-alt-install`. If you want to customize your
306 installation directories more heavily, see section :ref:`inst-custom-install` on
310 .. _inst-alt-install:
316 the standard location for third-party Python modules. For example, on a Unix
317 system you might not have permission to write to the standard third-party module
332 can pass ``--user``, or ``--home``, or ``--prefix`` and ``--exec-prefix``, or
333 ``--install-base`` and ``--install-platbase``, but you can't mix from these
337 .. _inst-alt-install-user:
340 ---------------------------------------
343 have write permission to the global site-packages directory or don't want to
346 python setup.py install --user
356 modules :file:`{userbase}/lib/python{X.Y}/site-packages`
367 modules :file:`{userbase}\\Python{XY}\\site-packages`
374 that the user site-packages directory is under normal conditions always included
379 The :command:`build_ext` command also has a ``--user`` option to add
385 .. _inst-alt-install-home:
388 ---------------------------------------
399 python setup.py install --home=<dir>
401 where you can supply any directory you like for the :option:`!--home` option. On
405 python setup.py install --home=~
408 to :ref:`modify Python's search path <inst-search-path>` or edit
412 The :option:`!--home` option defines the installation base directory. Files are
427 The :option:`!--home` option used to be supported only on Unix.
430 .. _inst-alt-install-prefix-unix:
433 ------------------------------------------------
437 into the third-party module directory of a different Python installation (or
439 trifle unusual, it is---that's why the user and home schemes come before. However,
444 since in those cases Python is part of "the system" rather than a local add-on.
449 /usr/bin/python setup.py install --prefix=/usr/local
458 /usr/local/bin/python setup.py install --prefix=/mnt/@server/export
460 In either case, the :option:`!--prefix` option defines the installation base, and
461 the :option:`!--exec-prefix` option defines the platform-specific installation
462 base, which is used for platform-specific files. (Currently, this just means
463 non-pure module distributions, but could be expanded to C libraries, binary
464 executables, etc.) If :option:`!--exec-prefix` is not supplied, it defaults to
465 :option:`!--prefix`. Files are installed as follows:
470 Python modules :file:`{prefix}/lib/python{X.Y}/site-packages`
471 extension modules :file:`{exec-prefix}/lib/python{X.Y}/site-packages`
477 There is no requirement that :option:`!--prefix` or :option:`!--exec-prefix`
482 standard Unix installation uses the prefix scheme, but with :option:`!--prefix`
483 and :option:`!--exec-prefix` supplied by Python itself as ``sys.prefix`` and
496 if your :option:`!--prefix` and :option:`!--exec-prefix` don't even point to an
500 .. _inst-alt-install-prefix-windows:
503 ---------------------------------------------------
506 installation under Windows is simpler than under Unix, the :option:`!--prefix`
510 python setup.py install --prefix="\Temp\Python"
514 The installation base is defined by the :option:`!--prefix` option; the
515 :option:`!--exec-prefix` option is not supported under Windows, which means that
522 modules :file:`{prefix}\\Lib\\site-packages`
529 .. _inst-custom-install:
535 :ref:`inst-alt-install` just don't do what you want. You might want to tweak just
547 Python modules ``--install-purelib``
548 extension modules ``--install-platlib``
549 all modules ``--install-lib``
550 scripts ``--install-scripts``
551 data ``--install-data``
552 C headers ``--install-headers``
557 (There are two installation base directories, and they are normally the same---
559 ``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will
560 override values computed or given for ``--install-purelib`` and
561 ``--install-platlib``, and is recommended for schemes that don't make a
565 under Unix---but you want scripts to go in :file:`~/scripts` rather than
567 :option:`!--install-scripts` option; in this case, it makes most sense to supply
571 python setup.py install --home=~ --install-scripts=scripts
577 :option:`!--install-scripts` option::
579 python setup.py install --install-scripts=/usr/local/bin
582 whatever your Python interpreter was installed with--- :file:`/usr/local/python`
585 If you maintain Python on Windows, you might want third-party modules to live in
588 ---you just have to remember that there are two types of modules to worry about,
592 python setup.py install --install-lib=Site
597 :mod:`site`). See section :ref:`inst-search-path` to find out how to modify
603 module-related files under :file:`python` in your home directory, and you want a
607 python setup.py install --home=~ \
608 --install-purelib=python/lib \
609 --install-platlib=python/lib.$PLAT \
610 --install-scripts=python/scripts
611 --install-data=python/data
615 python setup.py install --home=~/python \
616 --install-purelib=lib \
617 --install-platlib='lib.$PLAT' \
618 --install-scripts=scripts
619 --install-data=data
621 ``$PLAT`` is not (necessarily) an environment variable---it will be expanded by
627 into your Distutils config file (see section :ref:`inst-config-files`)::
630 install-base=$HOME
631 install-purelib=python/lib
632 install-platlib=python/lib.$PLAT
633 install-scripts=python/scripts
634 install-data=python/data
639 install-base=$HOME/python
640 install-purelib=lib
641 install-platlib=lib.$PLAT
642 install-scripts=scripts
643 install-data=data
648 python setup.py install --install-base=/tmp
661 the Distutils are the only ones you can use.) See section :ref:`inst-config-files`
664 .. XXX need some Windows examples---when would custom installation schemes be
670 .. _inst-search-path:
673 ------------------------------
683 [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
687 ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2',
688 '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload',
689 '/usr/local/lib/python2.3/site-packages']
695 :file:`{...}/site-packages/` directory, but you may want to install Python
698 Add-on Python modules might then belong in :file:`/www/python`, and in order to
703 that's already on Python's path, usually to the :file:`.../site-packages/`
716 imported when the Python interpreter is executed, unless the :option:`-S` switch
732 '/www/python/lib/pythonX.Y/plat-linux2', ...]``.
745 .. _inst-config-files:
753 configuration files, which will be consulted before the command-line is parsed.
755 command-line will in turn override configuration files. Furthermore, if
760 .. _inst-config-filenames:
763 ----------------------------------
769 +--------------+----------------------------------------------------------+-------+
773 +--------------+----------------------------------------------------------+-------+
775 +--------------+----------------------------------------------------------+-------+
777 +--------------+----------------------------------------------------------+-------+
781 +--------------+-------------------------------------------------+-------+
785 +--------------+-------------------------------------------------+-------+
787 +--------------+-------------------------------------------------+-------+
789 +--------------+-------------------------------------------------+-------+
792 passing the `--no-user-cfg` option.
797 Strictly speaking, the system-wide configuration file lives in the directory
800 :file:`{prefix}/lib/python1.5/site-packages/distutils`, so the system
817 part of the standard library---so the system configuration file would be
828 .. _inst-config-syntax:
831 ----------------------
856 build-base=blib
859 which corresponds to the command-line arguments ::
861 python setup.py build --build-base=blib --force
863 except that including the :command:`build` command on the command-line means
870 :option:`!--help` option, e.g.::
872 python setup.py build --help
875 :option:`!--help` without a command::
877 python setup.py --help
882 .. _inst-building-ext:
895 .. _inst-tweak-flags:
898 ------------------------------
904 cross-compile Python.
932 :option:`!-I`, :option:`!-D`, :option:`!-U` or :option:`!-C`.
934 * *library* is anything ending in :file:`.a` or beginning with :option:`!-l` or
935 :option:`!-L`.
944 :option:`!-lm` to the line::
946 foo foomodule.c -lm
949 the :option:`!-Xcompiler` *arg* and :option:`!-Xlinker` *arg* options::
951 foo foomodule.c -Xcompiler -o32 -Xlinker -shared -lm
953 The next option after :option:`!-Xcompiler` and :option:`!-Xlinker` will be
955 be passed the :option:`!-o32` option, and the linker will be passed
956 :option:`!-shared`. If a compiler option requires an argument, you'll have to
957 supply multiple :option:`!-Xcompiler` options; for example, to pass ``-x c++``
958 the :file:`Setup` file would have to contain ``-Xcompiler -x -Xcompiler c++``.
965 .. _inst-non-ms-compilers:
967 Using non-Microsoft compilers on Windows
968 ----------------------------------------
985 .. Should we mention that users have to create cfg-files for the compiler?
1008 python setup.py build --compiler=bcpp
1011 this in your personal or system-wide configuration file for Distutils (see
1012 section :ref:`inst-config-files`.)
1022 Document describing how to use Borland's free command-line C++ compiler to build
1040 python setup.py build --compiler=cygwin
1042 and for Cygwin in no-cygwin mode [#]_ or for MinGW type::
1044 python setup.py build --compiler=mingw32
1047 consider writing it in your personal or system-wide configuration file for
1048 Distutils (see section :ref:`inst-config-files`.)
1054 binutils-2.13.90-20030111-1).
1062 .. I don't understand what the next line means. --amk
1076 /cygwin/bin/dlltool --dllname python25.dll --def python25.def --output-lib libpython25.a
1095 .. [#] This also means you could replace all existing COFF-libraries with OMF-libraries