Change import order with *.pth files

Andrea Gavana andrea.gavana at gmail.com
Sun Oct 2 17:29:24 EDT 2011


Hi All,

    my apologies if this is a dumb question, but I couldn't find a solution
 - possibly because I am not sure how to state my problem in a short
sentence.

Let's say I am using a package called "blah", and this package is already
installed on site-packages (and I need it to be there) with a name
"blah-1.2-win". In the site-packages folder, there is a pth file called
"blah.pth" which contains this line:

blah-1.2-win

To redirect Python to the correct folder when I type "import blah". Anyway,
now I am developing another version of this package and it's called
"blah-2.0-win", and it sits on my computer into a different folder (not on
site-packages, on an entire different drive in reality). How can I tell
Python *not* to use the version inside site-packages but to use the other
one in my development folder (without touching the pth file in
site-packages, of course)?

I have tried fiddling with sys.path and to create a local (in my development
folder) pth file, to no avail. I hope I have been able to explain my problem
clearly... This is on Windows, Python 2.5 to 2.7.

Thank you in advance for your suggestions.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111003/f02245d2/attachment.html>


More information about the Python-list mailing list