If I have packages installed from easy_install, the eggs are prepended to sys.path
before the items in the PYTHONPATH
variable.
Fo
I have done something like the following to prepend to the system path when running a top-level python executable file:
import sys
sys.path = [""] + sys.path
Often, the "
for me involves use of the __file__
attribute to do relative look up for a path that includes the top-level module for my project. This is not recommended for use in producing, eggs, though I don't seem to mind the consequences. There may be another alternative to __file__
.