[Python-ideas] problems with import

Steven D'Aprano steve at pearwood.info
Fri Jun 27 21:19:26 CEST 2014


On Fri, Jun 27, 2014 at 02:33:07PM -0400, Antoine Pitrou wrote:
> Le 27/06/2014 13:12, Steven D'Aprano a écrit :
> >On Fri, Jun 27, 2014 at 09:05:48AM -0400, Neal Becker wrote:
> >[...]
> >>Now I also have
> >>~/.local/lib/python2.7/site-packages/hgext
> >>
> >>but python won't search there for extensions.  Once if finds the system 
> >>hgext
> >>directory, it won't look also in the local one.
> >
> >Re-arrange sys.path so that the local site-packages comes first,
> >before the global site-packages. (I'm surprised Python doesn't
> >already do this.)
> 
> Then he would have the reverse problem: once he installs a user-local hg 
> extension, the bundled (official) hg extensions wouldn't be reachable 
> anymore.

Naturally, but I assumed that the only reason you would install 
something locally was if you intended it to over-ride the global 
version. If that's not the case, then you're right, it's an issue for 
Mercurial to solve.


-- 
Steven


More information about the Python-ideas mailing list