[Distutils] Installing packages using pip

Paul Moore p.f.moore at gmail.com
Sat Nov 14 06:12:26 EST 2015


On 13 November 2015 at 23:38, Nathaniel Smith <njs at pobox.com> wrote:
> But details of R's execution model make this easier to do.

Indeed. I don't know how R works, but Python's module caching
behaviour would mean this would be full of surprising and confusing
corner cases ("I upgraded but I'm still getting the old version" being
the simplest and most obvious one).

> Maybe it could be supported for the special case of installing new packages with no upgrades?

Possibly. But the rules on what is allowed would likely be fairly
complex and hard to understand.

> A good way to environment with the possibilities would be to write a %pip
> magic for ipython:

Equally, if you want to see how well the model works, you can just
start up a Python interpreter session and when you want to install
something, do so in a separate command window. All of the issues I can
think of are basically a result of not restarting Python after
installing a new package, so you'd probably see most of them like
that.

Conversely, if IPython has a "restart the kernel" command, then I see
no reason why a %pip magic wouldn't be fine, as long as you restart
the kernel after each (series of) %pip commands. The same with Idle,
if there's a "restart the interpreter" option, that would be safe. Of
course this doesn't solve the issue of "I want to keep my work in
progress" but the fact that you can't is an easier restriction to
explain than "only when installing new packages where none of the
package install nor any of its dependencies triggers an upgrade"...

Paul


More information about the Distutils-SIG mailing list