Python Environment Variables

PythonServer Side ProgrammingProgramming

Here are important environment variables, which can be recognized by Python −

Sr.No.Variable & Description
It has a role similar to PATH. This variable tells the Python interpreter where to locate the module files imported into a program. It should include the Python source library directory and the directories containing Python source code. PYTHONPATH is sometimes preset by the Python installer.
It contains the path of an initialization file containing Python source code. It is executed every time you start the interpreter. It is named as in Unix and it contains commands that load utilities or modify PYTHONPATH.
It is used in Windows to instruct Python to find the first case-insensitive match in an import statement. Set this variable to any value to activate it.
It is an alternative module search path. It is usually embedded in the PYTHONSTARTUP or PYTHONPATH directories to make switching module libraries easy.
Published on 24-Jan-2020 15:37:59