Python uses the directories listed in PYTHONPATH to find a module. How can I assure that the module I am importing is on this list of paths?
Ene Uran
638
Posting Virtuoso
Recommended Answers
Jump to PostThis will show the PYTHONPATH:
# show the system path for Python = PYTHONPATH import sys print sys.path # notice that your present working folder is print sys.path[0]
To add another path, the one with your module perhaps, do this at the beginning of your program:
All 3 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Ene Uran
638
Posting Virtuoso
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.