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