@@ -42,9 +42,11 @@ After starting the installer, one of two options may be selected:
4242If you select "Install Now":
4343
4444* You will *not * need to be an administrator (unless a system update for the
45- C Runtime Library is required)
45+ C Runtime Library is required or you install the :ref: `launcher ` for all
46+ users)
4647* Python will be installed into your user directory
47- * The :ref: `launcher ` will *also * be installed into your user directory
48+ * The :ref: `launcher ` will be installed according to the option at the bottom
49+ of the first pace
4850* The standard library, test suite, launcher and pip will be installed
4951* If selected, the install directory will be added to your :envvar: `PATH `
5052* Shortcuts will only be visible for the current user
@@ -60,7 +62,7 @@ installation". In this case:
6062* Python will be installed into the Program Files directory
6163* The :ref: `launcher ` will be installed into the Windows directory
6264* Optional features may be selected during installation
63- * The standard library will be pre-compiled to bytecode
65+ * The standard library can be pre-compiled to bytecode
6466* If selected, the install directory will be added to the system :envvar: `PATH `
6567* Shortcuts are available for all users
6668
@@ -649,6 +651,8 @@ target Python.
649651
650652
651653
654+ .. finding_modules:
655+
652656 Finding modules
653657===============
654658
@@ -718,6 +722,8 @@ following advice will prevent conflicts with other installations:
718722* Include a ``pyvenv.cfg `` file alongside your executable containing
719723 ``applocal = true ``. This will ensure that your own directory will be used to
720724 resolve paths even if you have included the standard library in a ZIP file.
725+ It will also ignore user site-packages and other paths listed in the
726+ registry.
721727
722728* If you are loading :file: `python3.dll ` or :file: `python35.dll ` in your own
723729 executable, explicitly call :c:func: `Py_SetPath ` or (at least)
@@ -733,7 +739,9 @@ following advice will prevent conflicts with other installations:
733739
734740These will ensure that the files in a system-wide installation will not take
735741precedence over the copy of the standard library bundled with your application.
736- Otherwise, your users may experience problems using your application.
742+ Otherwise, your users may experience problems using your application. Note that
743+ the first suggestion is the best, as the other may still be susceptible to
744+ non-standard paths in the registry and user site-packages.
737745
738746Additional modules
739747==================
@@ -822,6 +830,83 @@ For extension modules, consult :ref:`building-on-windows`.
822830 by Trent Apted et al, 2007
823831
824832
833+ Embedded Distribution
834+ =====================
835+
836+ .. versionadded :: 3.5
837+
838+ The embedded distribution is a ZIP file containing a minimal Python environment.
839+ It is intended for acting as part of another application, rather than being
840+ directly accessed by end-users.
841+
842+ When extracted, the embedded distribution is (almost) fully isolated from the
843+ user's system, including environment variables, system registry settings, and
844+ installed packages. The standard library is included as pre-compiled and
845+ optimized ``.pyc `` files in a ZIP, and ``python3.dll ``, ``python35.dll ``,
846+ ``python.exe `` and ``pythonw.exe `` are all provided. Tcl/tk (including all
847+ dependants, such as Idle), pip and the Python documentation are not included.
848+
849+ .. note ::
850+
851+ The embedded distribution does not include the `Microsoft C Runtime
852+ <http://www.microsoft.com/en-us/download/details.aspx?id=48145> `_ and it is
853+ the responsibility of the application installer to provide this. The
854+ runtime may have already been installed on a user's system previously or
855+ automatically via Windows Update, and can be detected by finding
856+ ``ucrtbase.dll `` in the system directory.
857+
858+ Third-party packages should be installed by the application installer alongside
859+ the embedded distribution. Using pip to manage dependencies as for a regular
860+ Python installation is not supported with this distribution, though with some
861+ care it may be possible to include and use pip for automatic updates. In
862+ general, third-party packages should be treated as part of the application
863+ ("vendoring") so that the developer can ensure compatibility with newer
864+ versions before providing updates to users.
865+
866+ The two recommended use cases for this distribution are described below.
867+
868+ Python Application
869+ ------------------
870+
871+ An application written in Python does not necessarily require users to be aware
872+ of that fact. The embedded distribution may be used in this case to include a
873+ private version of Python in an install package. Depending on how transparent it
874+ should be (or conversely, how professional it should appear), there are two
875+ options.
876+
877+ Using a specialized executable as a launcher requires some coding, but provides
878+ the most transparent experience for users. With a customized launcher, there are
879+ no obvious indications that the program is running on Python: icons can be
880+ customized, company and version information can be specified, and file
881+ associations behave properly. In most cases, a custom launcher should simply be
882+ able to call ``Py_Main `` with a hard-coded command line.
883+
884+ The simpler approach is to provide a batch file or generated shortcut that
885+ directly calls the ``python.exe `` or ``pythonw.exe `` with the required
886+ command-line arguments. In this case, the application will appear to be Python
887+ and not its actual name, and users may have trouble distinguishing it from other
888+ running Python processes or file associations.
889+
890+ With the latter approach, packages should be installed as directories alongside
891+ the Python executable to ensure they are available on the path. With the
892+ specialized launcher, packages can be located in other locations as there is an
893+ opportunity to specify the search path before launching the application.
894+
895+ Embedding Python
896+ ----------------
897+
898+ Applications written in native code often require some form of scripting
899+ language, and the embedded Python distribution can be used for this purpose. In
900+ general, the majority of the application is in native code, and some part will
901+ either invoke ``python.exe `` or directly use ``python3.dll ``. For either case,
902+ extracting the embedded distribution to a subdirectory of the application
903+ installation is sufficient to provide a loadable Python interpreter.
904+
905+ As with the application use, packages can be installed to any location as there
906+ is an opportunity to specify search paths before initializing the interpreter.
907+ Otherwise, there is no fundamental differences between using the embedded
908+ distribution and a regular installation.
909+
825910Other resources
826911===============
827912
0 commit comments