Chapter 1. Command line and environment 8 Python Setup and Usage, Release 3.9.5 • -X dev : enable Python Development Mode, introducing additional runtime checks that are too expen- sive to be enabled by default. • -X utf8 enables UTF-8 mode for operating system interfaces, overriding the default locale-aware mode. -X utf8=0 explicitly disables UTF-8 mode (even when it would otherwise activate automati- cally). See$_{PYTHONUTF8}$ for more details. • -X pycache_prefix=PATH enables writing .pyc files to a parallel tree rooted at the given direc- tory instead of to the code tree. See also PYTHONPYCACHEPREFIX . It also allows passing arbitrary values and retrieving them through the sys._xoptions dictionary. Changed in version 3.2: The -X option was added. New in version 3.3: The$_{-X faulthandler}$ option. New in version 3.4: The$_{-X showrefcount}$ and$_{-X tracemalloc}$ options. New in version 3.6: The$_{-X showalloccount}$ option. New in version 3.7: The$_{-X importtime}$ ,$_{-X dev}$ and$_{-X utf8}$ options. New in version 3.8: The$_{-X pycache_prefix}$ option. The$_{-X dev}$ option now logs$_{close()}$ excep- tions in$_{io.IOBase}$ destructor. Changed in version 3.9: Using -X dev option, check encoding and errors arguments on string encoding and decoding operations. The$_{-X showalloccount}$ option has been removed. Deprecated since version 3.9, will be removed in version 3.10: The$_{-X oldparser}$ option. Reserved for use by Jython. These environment variables influence Python’s behavior, they are processed before the command-line switches other than -E or -I. It is customary that command-line switches override environmental variables where there is a conflict. The default search path is installation dependent, but generally begins with prefix /lib/ python $_{version}$(see$_{PYTHONHOME}$ above). It is always appended to$_{PYTHONPATH}$ . An additional directory will be inserted in the search path in front of$_{PYTHONPATH}$ as described above under Interface options . The search path can be manipulated from within a Python program as the variable$_{sys.}$ $_{path}$. In addition to normal directories, individual$_{PYTHONPATH}$ entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles. Augment the default search path for module files. The format is the same as the shell’s$_{PATH}$ : one or more directory pathnames separated by$_{os.pathsep}$(e.g. colons on Unix or semicolons on Windows). Non- existent directories are silently ignored. When PYTHONHOME is set to a single directory, its value replaces both $_{prefix}$and exec_prefix . To specify different values for these, set$_{PYTHONHOME}$ to$_{prefix}$$_{:}$ exec_prefix . Change the location of the standard Python libraries. By default, the libraries are searched in$_{prefix}$$_{/lib/}$ python $_{version}$and exec_prefix /lib/python $_{version}$, where $_{prefix}$and exec_prefix are installation-dependent directories, both defaulting to$_{/usr/local}$ . PYTHONPATH PYTHONHOME -J 1.2 Environment variables 1.1.4 Options you shouldn’t use