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