What is the purpose of the 'PYTHONPATH' environment variable in Python?
Correct answer
C. To specify the search path for Python modules
14 views
C. To specify the search path for Python modules
14 views
The 'PYTHONPATH' environment variable in Python is used to specify additional directories where the Python interpreter should look for modules when importing them. It allows you to customize the search path for Python modules, similar to the 'sys.path' variable, but at the environment level.
Not sure why the answer is C? Ask here and get an explanation.