How to change sys.path or PYTHONPATH in Python

Posted by xmodulo on Dec 9, 2015 6:23 AM EDT
Xmodulo; By Dan Nanni
Mail this story
Print this story

When the Python interpreter executes a program which imports a module, it examines all directory paths listed in sys.path until it finds the module. By default, sys.path is constructed as a concatenation of (1) the current working directory, (2) content of PYTHONPATH environment variable, and (3) a set of default paths supplied by the installed Python interpreter.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Developer, Python

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.