How can I use the `PYTHONPATH` environment variable to influence module searching?

Responsive Ad Header

Question

Grade: Education Subject: Support
How can I use the `PYTHONPATH` environment variable to influence module searching?
Asked by:
82 Viewed 82 Answers

Answer (82)

Best Answer
(274)
'PYTHONPATH' is an environment variable that lists directories where Python should look for modules. You can set this variable to include the directory containing your local module. However, using virtual environments is generally a more organized and recommended approach.