@@ -378,7 +378,9 @@ may be changed from ``.``, and the package will be installed into a
378
378
subdirectory. By default, the subdirectory is named the same as the package,
379
379
and without the ``-ExcludeVersion `` option this name will include the specific
380
380
version installed. Inside the subdirectory is a ``tools `` directory that
381
- contains the Python installation::
381
+ contains the Python installation:
382
+
383
+ .. code-block :: doscon
382
384
383
385
# Without -ExcludeVersion
384
386
> .\python.3.5.2\tools\python.exe -V
@@ -425,7 +427,7 @@ dependants, such as Idle), pip and the Python documentation are not included.
425
427
.. note ::
426
428
427
429
The embedded distribution does not include the `Microsoft C Runtime
428
- <https://www .microsoft.com/en-us/download/details.aspx?id=48145 > `_ and it is
430
+ <https://docs .microsoft.com/en-US/cpp/windows/latest-supported-vc-redist#visual-studio-2015-2017-2019-and-2022 > `_ and it is
429
431
the responsibility of the application installer to provide this. The
430
432
runtime may have already been installed on a user's system previously or
431
433
automatically via Windows Update, and can be detected by finding
@@ -559,27 +561,22 @@ System variables, you need non-restricted access to your machine
559
561
Windows will concatenate User variables *after * System variables, which may
560
562
cause unexpected results when modifying :envvar: `PATH `.
561
563
562
- The :envvar: `PYTHONPATH ` variable is used by all versions of Python 2 and
563
- Python 3, so you should not permanently configure this variable unless it
564
- only includes code that is compatible with all of your installed Python
564
+ The :envvar: `PYTHONPATH ` variable is used by all versions of Python,
565
+ so you should not permanently configure it unless the listed paths
566
+ only include code that is compatible with all of your installed Python
565
567
versions.
566
568
567
569
.. seealso ::
568
570
569
- https://www.microsoft.com/en-us/wdsi/help/folder-variables
570
- Environment variables in Windows NT
571
-
572
- https://technet.microsoft.com/en-us/library/cc754250.aspx
573
- The SET command, for temporarily modifying environment variables
571
+ https://docs.microsoft.com/en-us/windows/win32/procthread/environment-variables
572
+ Overview of environment variables on Windows
574
573
575
- https://technet .microsoft.com/en-us/library/cc755104.aspx
576
- The SETX command, for permanently modifying environment variables
574
+ https://docs .microsoft.com/en-us/windows-server/administration/windows-commands/set_1
575
+ The `` set `` command, for temporarily modifying environment variables
577
576
578
- https://support .microsoft.com/en-us/help/310519/how-to-manage-environment-variables-in- windows-xp
579
- How To Manage Environment Variables in Windows XP
577
+ https://docs .microsoft.com/en-us/windows-server/administration/ windows-commands/setx
578
+ The `` setx `` command, for permanently modifying environment variables
580
579
581
- https://www.chem.gla.ac.uk/~louis/software/faq/q1.html
582
- Setting Environment variables, Louis J. Farrugia
583
580
584
581
.. _windows-path-mod :
585
582
@@ -677,48 +674,40 @@ From the command-line
677
674
System-wide installations of Python 3.3 and later will put the launcher on your
678
675
:envvar: `PATH `. The launcher is compatible with all available versions of
679
676
Python, so it does not matter which version is installed. To check that the
680
- launcher is available, execute the following command in Command Prompt:
681
-
682
- ::
677
+ launcher is available, execute the following command in Command Prompt::
683
678
684
679
py
685
680
686
681
You should find that the latest version of Python you have installed is
687
682
started - it can be exited as normal, and any additional command-line
688
683
arguments specified will be sent directly to Python.
689
684
690
- If you have multiple versions of Python installed (e.g., 2.7 and |version |) you
691
- will have noticed that Python |version | was started - to launch Python 2.7, try
692
- the command:
693
-
694
- ::
695
-
696
- py -2.7
685
+ If you have multiple versions of Python installed (e.g., 3.7 and |version |) you
686
+ will have noticed that Python |version | was started - to launch Python 3.7, try
687
+ the command::
697
688
698
- If you want the latest version of Python 2.x you have installed, try the
699
- command:
689
+ py -3.7
700
690
701
- ::
691
+ If you want the latest version of Python 2 you have installed, try the
692
+ command::
702
693
703
694
py -2
704
695
705
- You should find the latest version of Python 2 .x starts.
696
+ You should find the latest version of Python 3 .x starts.
706
697
707
- If you see the following error, you do not have the launcher installed:
708
-
709
- ::
698
+ If you see the following error, you do not have the launcher installed::
710
699
711
700
'py' is not recognized as an internal or external command,
712
701
operable program or batch file.
713
702
714
703
Per-user installations of Python do not add the launcher to :envvar: `PATH `
715
704
unless the option was selected on installation.
716
705
717
- ::
706
+ The command ::
718
707
719
708
py --list
720
709
721
- You should see the currently installed versions of Python.
710
+ displays the currently installed version(s) of Python.
722
711
723
712
Virtual environments
724
713
^^^^^^^^^^^^^^^^^^^^
@@ -744,9 +733,7 @@ following contents
744
733
import sys
745
734
sys.stdout.write(" hello from Python %s \n " % (sys.version,))
746
735
747
- From the directory in which hello.py lives, execute the command:
748
-
749
- ::
736
+ From the directory in which hello.py lives, execute the command::
750
737
751
738
py hello.py
752
739
@@ -759,9 +746,9 @@ is printed. Now try changing the first line to be:
759
746
760
747
Re-executing the command should now print the latest Python 3.x information.
761
748
As with the above command-line examples, you can specify a more explicit
762
- version qualifier. Assuming you have Python 2.6 installed, try changing the
763
- first line to ``#! python2.6 `` and you should find the 2.6 version
764
- information printed.
749
+ version qualifier. Assuming you have Python 3.7 installed, try changing
750
+ the first line to ``#! python3.7 `` and you should find the | version |
751
+ version information printed.
765
752
766
753
Note that unlike interactive use, a bare "python" will use the latest
767
754
version of Python 2.x that you have installed. This is for backward
@@ -814,8 +801,8 @@ shebang lines starting with ``/usr``.
814
801
Any of the above virtual commands can be suffixed with an explicit version
815
802
(either just the major version, or the major and minor version).
816
803
Furthermore the 32-bit version can be requested by adding "-32" after the
817
- minor version. I.e. ``/usr/bin/python2 .7-32 `` will request usage of the
818
- 32-bit python 2 .7.
804
+ minor version. I.e. ``/usr/bin/python3 .7-32 `` will request usage of the
805
+ 32-bit python 3 .7.
819
806
820
807
.. versionadded :: 3.7
821
808
@@ -908,19 +895,19 @@ Examples:
908
895
``python2 `` will use the latest Python 2.x version installed and
909
896
the command ``python3 `` will use the latest Python 3.x installed.
910
897
911
- * The commands ``python3.1 `` and `` python2 .7 `` will not consult any
898
+ * The command ``python3.7 `` will not consult any
912
899
options at all as the versions are fully specified.
913
900
914
901
* If ``PY_PYTHON=3 ``, the commands ``python `` and ``python3 `` will both use
915
902
the latest installed Python 3 version.
916
903
917
- * If ``PY_PYTHON=3.1 -32 ``, the command ``python `` will use the 32-bit
918
- implementation of 3.1 whereas the command ``python3 `` will use the latest
904
+ * If ``PY_PYTHON=3.7 -32 ``, the command ``python `` will use the 32-bit
905
+ implementation of 3.7 whereas the command ``python3 `` will use the latest
919
906
installed Python (PY_PYTHON was not considered at all as a major
920
907
version was specified.)
921
908
922
- * If ``PY_PYTHON=3 `` and ``PY_PYTHON3=3.1 ``, the commands
923
- ``python `` and ``python3 `` will both use specifically 3.1
909
+ * If ``PY_PYTHON=3 `` and ``PY_PYTHON3=3.7 ``, the commands
910
+ ``python `` and ``python3 `` will both use specifically 3.7
924
911
925
912
In addition to environment variables, the same settings can be configured
926
913
in the .INI file used by the launcher. The section in the INI file is
@@ -931,21 +918,21 @@ an environment variable will override things specified in the INI file.
931
918
932
919
For example:
933
920
934
- * Setting ``PY_PYTHON=3.1 `` is equivalent to the INI file containing:
921
+ * Setting ``PY_PYTHON=3.7 `` is equivalent to the INI file containing:
935
922
936
923
.. code-block :: ini
937
924
938
925
[defaults]
939
- python =3.1
926
+ python =3.7
940
927
941
- * Setting ``PY_PYTHON=3 `` and ``PY_PYTHON3=3.1 `` is equivalent to the INI file
928
+ * Setting ``PY_PYTHON=3 `` and ``PY_PYTHON3=3.7 `` is equivalent to the INI file
942
929
containing:
943
930
944
931
.. code-block :: ini
945
932
946
933
[defaults]
947
934
python =3
948
- python3 =3.1
935
+ python3 =3.7
949
936
950
937
Diagnostics
951
938
-----------
@@ -1132,13 +1119,14 @@ is a collection of modules for advanced Windows-specific support. This includes
1132
1119
utilities for:
1133
1120
1134
1121
* `Component Object Model
1135
- <https://docs.microsoft.com/en-us/windows/desktop /com/component-object-model--com--portal> `_
1122
+ <https://docs.microsoft.com/en-us/windows/win32 /com/component-object-model--com--portal> `_
1136
1123
(COM)
1137
1124
* Win32 API calls
1138
1125
* Registry
1139
1126
* Event log
1140
- * `Microsoft Foundation Classes <https://msdn.microsoft.com/en-us/library/fe1cf721%28VS.80%29.aspx >`_ (MFC)
1141
- user interfaces
1127
+ * `Microsoft Foundation Classes
1128
+ <https://docs.microsoft.com/en-us/cpp/mfc/mfc-desktop-applications> `_
1129
+ (MFC) user interfaces
1142
1130
1143
1131
`PythonWin <https://web.archive.org/web/20060524042422/
1144
1132
https://www.python.org/windows/pythonwin/> `_ is a sample MFC application
@@ -1149,7 +1137,7 @@ shipped with PyWin32. It is an embeddable IDE with a built-in debugger.
1149
1137
`Win32 How Do I...? <http://timgolden.me.uk/python/win32_how_do_i.html >`_
1150
1138
by Tim Golden
1151
1139
1152
- `Python and COM <http ://www.boddie.org.uk/python/COM.html >`_
1140
+ `Python and COM <https ://www.boddie.org.uk/python/COM.html >`_
1153
1141
by David and Paul Boddie
1154
1142
1155
1143
@@ -1163,18 +1151,6 @@ you can distribute your application without requiring your users to install
1163
1151
Python.
1164
1152
1165
1153
1166
- WConio
1167
- ------
1168
-
1169
- Since Python's advanced terminal handling layer, :mod: `curses `, is restricted to
1170
- Unix-like systems, there is a library exclusive to Windows as well: Windows
1171
- Console I/O for Python.
1172
-
1173
- `WConio <http://newcenturycomputers.net/projects/wconio.html >`_ is a wrapper for
1174
- Turbo-C's :file: `CONIO.H `, used to create text user interfaces.
1175
-
1176
-
1177
-
1178
1154
Compiling Python on Windows
1179
1155
===========================
1180
1156
@@ -1184,21 +1160,13 @@ latest release's source or just grab a fresh `checkout
1184
1160
<https://devguide.python.org/setup/#getting-the-source-code> `_.
1185
1161
1186
1162
The source tree contains a build solution and project files for Microsoft
1187
- Visual Studio 2015 , which is the compiler used to build the official Python
1163
+ Visual Studio, which is the compiler used to build the official Python
1188
1164
releases. These files are in the :file: `PCbuild ` directory.
1189
1165
1190
1166
Check :file: `PCbuild/readme.txt ` for general information on the build process.
1191
1167
1192
-
1193
1168
For extension modules, consult :ref: `building-on-windows `.
1194
1169
1195
- .. seealso ::
1196
-
1197
- `Python + Windows + distutils + SWIG + gcc MinGW <http://sebsauvage.net/python/mingw.html >`_
1198
- or "Creating Python extensions in C/C++ with SWIG and compiling them with
1199
- MinGW gcc under Windows" or "Installing Python extension with distutils
1200
- and without Microsoft Visual C++" by Sébastien Sauvage, 2003
1201
-
1202
1170
1203
1171
Other Platforms
1204
1172
===============
@@ -1207,12 +1175,12 @@ With ongoing development of Python, some platforms that used to be supported
1207
1175
earlier are no longer supported (due to the lack of users or developers).
1208
1176
Check :pep: `11 ` for details on all unsupported platforms.
1209
1177
1210
- * `Windows CE <http://pythonce.sourceforge.net/ >`_ is still supported.
1211
- * The ` Cygwin <https://cygwin .com/ >`_ installer offers to install the Python
1212
- interpreter as well (cf. ` Cygwin package source
1213
- <ftp ://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/mirrors/cygnus/
1214
- release/python> `_, ` Maintainer releases
1215
- <http://www.tishler.net/jason/software/python/> `_)
1178
+ * `Windows CE <http://pythonce.sourceforge.net/ >`_ is
1179
+ ` no longer supported <https://github .com/python/cpython/issues/71542 >`__
1180
+ since Python 3 (if it ever was).
1181
+ * The ` Cygwin < https ://cygwin.com/ >`_ installer offers to install the
1182
+ ` Python interpreter < https://cygwin.com/packages/summary/python3.html >`__
1183
+ as well
1216
1184
1217
1185
See `Python for Windows <https://www.python.org/downloads/windows/ >`_
1218
1186
for detailed information about platforms with pre-compiled installers.
0 commit comments