[ovs-discuss] any help from Python experts? (was: Re: Branch v2.6.1 repo does not make (github))

Ben Pfaff blp at ovn.org
Thu Feb 2 16:17:26 UTC 2017


On Thu, Feb 02, 2017 at 03:55:17AM -0500, Robert Wojciechowicz wrote:
> On Wed, Feb 01, 2017 at 08:22:43AM -0800, Ben Pfaff wrote:
> > On Wed, Feb 01, 2017 at 09:45:56AM -0500, Robert Wojciechowicz wrote:
> > > On Tue, Jan 31, 2017 at 03:45:48PM -0800, Ben Pfaff wrote:
> > > > OK, so looking closer...
> > > > 
> > > > The OVS build process runs a few Python programs using syntax like this:
> > > >         PYTHONPATH=$(srcdir)/python:$(PYTHONPATH) python program.py
> > > > 
> > > > This means that sys.path ends up looking like:
> > > > 
> > > > ['/dir/for/program.py', ..., '/usr/lib/python2.7/dist-packages', ...
> > > >  '$(srcdir)/python', ...]
> > > 
> > > Not really, sys.path is initialized by current working dir, PYTHONPATH 
> > > and then followed by installation-dependent default paths.
> > 
> > You make it sound like I'm making this up!  But my remarks were based on
> 
> No, I just wanted to explain that if there is a clean python installation
> and PYTHONPATH variable defined the search order is clearly defined.
> Unfortunately in real life there are also other things involved,
> which may be exisiting in the system or not. For instance there are
> so called python path files (.pth), which can modify sys.path also.
> Some package installation installation tools (e.g. easy_install)
> create such files and then it is hard to make sure in what order
> packages will be searched.

Thanks for the hint.  I had not heard of these .pth files before, or
even of easy_install, but apparently I had used the latter at some point
and forgotten it.

I've now deleted and edited a bunch of these .pth files and now my
Python installation seems sane.  Wow, "easy_install" is a real menace.

Thanks!


More information about the discuss mailing list