Weird import failure with "nosetests --processes=1"

Roy Smith roy at panix.com
Fri Nov 30 05:18:48 CET 2012


In article <50b78e26$0$6945$e4fe514c at news2.news.xs4all.nl>,
 Hans Mulder <hansmu at xs4all.nl> wrote:

> That is baffling indeed.  It looks like nose is adding some
> directory to sys.path, which contains a module pyza.py instead
> of a package.

We finally figured it out.  As it turns out, that's pretty close.

> Another idea might be to delete all *.pyc files below
> /home/roy/deploy/current/ and /home/roy/songza/

I've got

sys.path.insert(0, '/home/roy/deploy/current')

in my virtualenv's usercustomize.py.  Also, though historical accident, 
I had (but don't any longer)

PYTHONPATH=/home/roy/songza

in my .profile.  And /home/roy/deploy/current is a symlink to 
/home/roy/songza!  So, I had two different paths to the same directory.  
Why this only showed up as a problem when running under nose in 
multiprocess mode, I have no clue.  And how it ended up thinking pyza 
was a module instead of a package, I also have no idea.

Crazy.



More information about the Python-list mailing list