[Tutor] force imports from site-packages?

Alex Hall mehgcap at gmail.com
Fri Oct 7 04:15:39 CEST 2011


Hi all,
I have managed to get a couple of packages in site-packages which
share names with some folders in the same directory as a program, or
at least a subdir somewhere below has the same name. Is there a way to
force my script to look in lib/site-packages before the script's
folder? I can't rename these folders since Git will get confused if I
do.
In other words, I have a package called LRSignature installed, but in
a subdir of my script's directory is another LRSignature folder which
is not an actual Python package. Python sees this non-package folder
first and so, quite rightly, throws an exception that the class of the
package I want, LRSignature.Sign, does not exist. It exists in the
site-packages copy, but Python won't overlook the nearer copy. How do
I make it do this? Thanks.

-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap


More information about the Tutor mailing list