What is PYTHONPATH environment variable in Python?

PythonServer Side ProgrammingProgramming

PYTHONPATH is an environment variable which you can set to add additional directories where python will look for modules and packages. For most installations, you should not set these variables since they are not needed for Python to run. Python knows where to find its standard library.

The only reason to set PYTHONPATH is to maintain directories of custom Python libraries that you do not want to install in the global default location (i.e., the site-packages directory).

Read the following docs to get a better understanding of Python environment variables: http://docs.python.org/using/cmdline.html#environment-variables

Published on 19-Dec-2017 17:15:58