diff options
Diffstat (limited to 'Doc/using')
-rw-r--r-- | Doc/using/cmdline.rst | 49 | ||||
-rw-r--r-- | Doc/using/configure.rst | 23 | ||||
-rw-r--r-- | Doc/using/windows.rst | 32 |
3 files changed, 82 insertions, 22 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index fa7c9cddf9c..40a46a62031 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -73,7 +73,7 @@ source. .. audit-event:: cpython.run_command command cmdoption-c - .. versionchanged:: next + .. versionchanged:: 3.14 *command* is automatically dedented before execution. .. option:: -m <module-name> @@ -539,11 +539,21 @@ Miscellaneous options * ``-X importtime`` to show how long each import takes. It shows module name, cumulative time (including nested imports) and self time (excluding nested imports). Note that its output may be broken in multi-threaded - application. Typical usage is ``python3 -X importtime -c 'import - asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`. + application. Typical usage is ``python -X importtime -c 'import asyncio'``. + + ``-X importtime=2`` enables additional output that indicates when an + imported module has already been loaded. In such cases, the string + ``cached`` will be printed in both time columns. + + See also :envvar:`PYTHONPROFILEIMPORTTIME`. .. versionadded:: 3.7 + .. versionchanged:: 3.14 + + Added ``-X importtime=2`` to also trace imports of loaded modules, + and reserved values other than ``1`` and ``2`` for future use. + * ``-X dev``: enable :ref:`Python Development Mode <devmode>`, introducing additional runtime checks that are too expensive to be enabled by default. See also :envvar:`PYTHONDEVMODE`. @@ -670,6 +680,13 @@ Miscellaneous options .. versionchanged:: 3.10 Removed the ``-X oldparser`` option. +.. versionremoved:: 3.14 + + :option:`!-J` is no longer reserved for use by Jython_, + and now has no special meaning. + + .. _Jython: https://www.jython.org/ + .. _using-on-controlling-color: Controlling color @@ -694,15 +711,6 @@ output. To control the color output only in the Python interpreter, the precedence over ``NO_COLOR``, which in turn takes precedence over ``FORCE_COLOR``. -Options you shouldn't use -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. option:: -J - - Reserved for use by Jython_. - -.. _Jython: https://www.jython.org/ - .. _using-on-envvars: @@ -984,12 +992,17 @@ conflict. .. envvar:: PYTHONPROFILEIMPORTTIME - If this environment variable is set to a non-empty string, Python will - show how long each import takes. + If this environment variable is set to ``1``, Python will show + how long each import takes. If set to ``2``, Python will include output for + imported modules that have already been loaded. This is equivalent to setting the :option:`-X` ``importtime`` option. .. versionadded:: 3.7 + .. versionchanged:: 3.14 + + Added ``PYTHONPROFILEIMPORTTIME=2`` to also trace imports of loaded modules. + .. envvar:: PYTHONASYNCIODEBUG @@ -1281,6 +1294,14 @@ conflict. .. versionadded:: 3.14 +.. envvar:: PYTHON_JIT + + On builds where experimental just-in-time compilation is available, this + variable can force the JIT to be disabled (``0``) or enabled (``1``) at + interpreter startup. + + .. versionadded:: 3.13 + Debug-mode variables ~~~~~~~~~~~~~~~~~~~~ diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index 3d3776acbc7..b914d3397b6 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -302,14 +302,21 @@ General Options .. option:: --enable-experimental-jit=[no|yes|yes-off|interpreter] - Indicate how to integrate the :ref:`JIT compiler <whatsnew313-jit-compiler>`. - - * ``no`` - build the interpreter without the JIT. - * ``yes`` - build the interpreter with the JIT. - * ``yes-off`` - build the interpreter with the JIT but disable it by default. - * ``interpreter`` - build the interpreter without the JIT, but with the tier 2 enabled interpreter. - - By convention, ``--enable-experimental-jit`` is a shorthand for ``--enable-experimental-jit=yes``. + Indicate how to integrate the :ref:`experimental just-in-time compiler <whatsnew314-jit-compiler>`. + + * ``no``: Don't build the JIT. + * ``yes``: Enable the JIT. To disable it at runtime, set the environment + variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`. + * ``yes-off``: Build the JIT, but disable it by default. To enable it at + runtime, set the environment variable :envvar:`PYTHON_JIT=1 <PYTHON_JIT>`. + * ``interpreter``: Enable the "JIT interpreter" (only useful for those + debugging the JIT itself). To disable it at runtime, set the environment + variable :envvar:`PYTHON_JIT=0 <PYTHON_JIT>`. + + ``--enable-experimental-jit=no`` is the default behavior if the option is not + provided, and ``--enable-experimental-jit`` is shorthand for + ``--enable-experimental-jit=yes``. See :file:`Tools/jit/README.md` for more + information, including how to install the necessary build-time dependencies. .. note:: diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index 57c6062ee43..c084392ca66 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -95,6 +95,9 @@ as ``python3.14.exe``) to be available. The directory will be administrator. Click Start and search for "Edit environment variables for your account" for the system settings page to add the path. +Each Python runtime you install will have its own directory for scripts. These +also need to be added to :envvar:`PATH` if you want to use them. + The Python install manager will be automatically updated to new releases. This does not affect any installs of Python runtimes. Uninstalling the Python install manager does not uninstall any Python runtimes. @@ -529,6 +532,25 @@ depending on whether it was installed from python.org or through the Windows Store. Attempting to run the executable directly from Program Files is not recommended. +To programmatically install or uninstall the MSIX without using your +distribution platform's native support, the `Add-AppxPackage +<https://learn.microsoft.com/powershell/module/appx/add-appxpackage>`_ and +`Remove-AppxPackage <https://learn.microsoft.com/powershell/module/appx/remove-appxpackage>`_ +PowerShell cmdlets are simplest to use: + +.. code:: + + $> Add-AppxPackage C:\Downloads\python-manager-25.0.msix + ... + $> Get-AppxPackage PythonSoftwareFoundation.PythonManager | Remove-AppxPackage + +The native APIs for package management may be found on the Windows +`PackageManager <https://learn.microsoft.com/uwp/api/windows.management.deployment.packagemanager>`_ +class. The :func:`!AddPackageAsync` method installs for the current user, or use +:func:`!StagePackageAsync` followed by :func:`!ProvisionPackageForAllUsersAsync` +to install the Python install manager for all users from the MSIX package. Users +will still need to install their own copies of Python itself, as there is no way +to trigger those installs without being a logged in user. .. _pymanager-admin-config: @@ -694,6 +716,16 @@ default). your ``pythonw.exe`` and ``pyw.exe`` aliases are consistent with your others. " + "``pip`` gives me a ""command not found"" error when I type it in my + terminal.","Have you activated a virtual environment? Run the + ``.venv\Scripts\activate`` script in your terminal to activate. + " + "","The package may be available but missing the generated executable. + We recommend using the ``python -m pip`` command instead, or alternatively + the ``python -m pip install --force pip`` command will recreate the + executables and show you the path to add to :envvar:`PATH`. These scripts are + separated for each runtime, and so you may need to add multiple paths. + " .. _windows-embeddable: |