[Distutils] Replacing pip.exe with a Python script

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Jul 15 15:44:43 CEST 2013

On 15 July 2013 14:39, Paul Moore <p.f.moore at gmail.com> wrote:
> I'm looking at the possibility of replacing the current setuptools entry
> point based pip executables with Python scripts. The biggest problem is that
> a script "pip.py" shadows the pip package, making "import pip" fail.
> I can get round this by deleting sys.path[0] (the location of the currently
> running script) but how robust is that? Are there any corner cases where it
> would break? Or alternatively, is there a better way to do this rather than
> messing directly with sys.path? I suspect this is a fairly common question,
> but my Google-fu is failing me :-(

Can you not just rename the pip module to _pip?


More information about the Distutils-SIG mailing list