Re: order of importing modules

2011-01-12 Thread Ben Finney
(Please don't top-post replies. Instead, reply in-line with the quoted material, removing irrelevant material. An example is this message.) Catherine Moroney writes: > I've looked at my sys.path variable and I see that it has a whole > bunch of site-package directories, followed by the contents

Re: order of importing modules

2011-01-12 Thread Dan Stromberg
I don't know where the site-packages directories are coming from - maybe a site.py or sitecustomize.py? Sometimes you can strace with a very large -s to see where something like this is coming from. -o is your friend for saving the output to a file in, EG, /tmp. What I usually do is to put speci

Re: order of importing modules

2011-01-12 Thread Chris Rebert
> Dan Stromberg wrote: >> On Tue, Jan 11, 2011 at 4:30 PM, Catherine Moroney >> wrote: >>> >>> In what order does python import modules on a Linux system?  I have a >>> package that is both installed in /usr/lib64/python2.5/site-packages, >>> and a newer version of the same module in a working dir

Re: order of importing modules

2011-01-12 Thread Catherine Moroney
I've looked at my sys.path variable and I see that it has a whole bunch of site-package directories, followed by the contents of my $PYTHONPATH variable, followed by a list of misc site-package variables (see below). I've verified that if I manually reverse the order of sys.path I can then import

Re: order of importing modules

2011-01-12 Thread Catherine Moroney
I've looked at my sys.path variable and I see that it has a whole bunch of site-package directories, followed by the contents of my $PYTHONPATH variable, followed by a list of misc site-package variables (see below). I've verified that if I manually reverse the order of sys.path I can then import

Re: order of importing modules

2011-01-11 Thread Ben Finney
Catherine Moroney writes: > In what order does python import modules on a Linux system? An import caused by a statement is done when that statement is executed. So the answer to that question is: in the order the statements occur in the execution flow. > I have a package that is both installed

Re: order of importing modules

2011-01-11 Thread Dan Stromberg
On Tue, Jan 11, 2011 at 4:30 PM, Catherine Moroney wrote: > In what order does python import modules on a Linux system?  I have a > package that is both installed in /usr/lib64/python2.5/site-packages, > and a newer version of the same module in a working directory. > > I want to import the versio

order of importing modules

2011-01-11 Thread Catherine Moroney
In what order does python import modules on a Linux system? I have a package that is both installed in /usr/lib64/python2.5/site-packages, and a newer version of the same module in a working directory. I want to import the version from the working directory, but when I print module.__file__ in