PYTHONPATH and eggs

geoffbache geoff.bache at jeppesen.com
Thu Mar 4 09:20:57 CET 2010


On Mar 4, 3:24 am, David Cournapeau <courn... at gmail.com> wrote:
> On Wed, Mar 3, 2010 at 7:14 PM, geoffbache <geoff.ba... at jeppesen.com> wrote:
> > Unfortunately, the location from PYTHONPATH ends up after the eggs in
> > sys.path so I can't persuade Python to import my version. The only way
> > I've found to fix it is to copy the main script and manually hack
> > sys.path at the start of it which isn't really very nice. I wonder if
> > there is any better way as I can't be the first person to want to do
> > this, surely?
>
> One way is to never install things as eggs: I have a script
> hard_install which forces things to always install with
> --single-externally-managed blablabla. This has worked very well for
> me, but may not always be applicable (in particular if you are on a
> platform where building things from sources is difficult).

Thanks for the tips. Is your script generic at all? I wonder if you'd
be prepared to share it?

Figuring out virtualenv would also be an option, as would figuring out
how to build my own egg, but both these solutions feel like overkill
to me just to enable a small bit of tweaking.

/Geoff



More information about the Python-list mailing list