While I like the concept of calling pip via an api (and let me pat myself on the back for suggesting it in the first place in this thread), I honestly think that if it is something that is allowed, it should be implemented with a fair bit of guards.  It would probably end up being a power-user feature - something to help manage deployments in some tricky environments - than a newbie feature.

Python is an IDE-less language, and I say this knowing full well what IDLE is.  We don't default to eclipse like java does, or Visual Studio like .NET languages (and C(++) on windows).  We do not have the default tooling in place to avoid using the command line.  Learning the command line is a vital skill for newbies.

Now, while this thread may or may not be about Windows newbies specifically, I do not tend to see this brought up for *nix newbies.  Is this because we assume that a *nix user will have to know the command line?  or that they are inherently power users?  If it is the latter, then I need to say that being a programmer also means being a power user.  We should guide new users to power user tools (the command line, powershell, etc), instead of trying to bend python to regular users who will eventually be power users anyways.

I guess I am suggesting maybe we try and find a way to shallow the learning curve into using the command line than to just implement commands in the repl itself.

all that said, IDLE could be tooled to intercept the syntax 'pip install foo' and print a more helpful message.

On 11/13/2015 15:27, Chris Barker wrote:


On Fri, Nov 13, 2015 at 12:09 PM, Nathaniel Smith <njs@pobox.com> wrote:

On Nov 13, 2015 12:00 PM, "Alexander Walters" <tritium-list@sdamon.com> wrote:
>
> import pip
> pip.install(PACKAGESPEC)
>
> something like that?

This would be extremely handy if it could be made to work reliably... But I'm skeptical about whether it can be made to work reliably. Consider all the fun things that could happen once you start upgrading packages while python is running, and might e.g. have half of an upgraded package already loaded into memory. It's like the reloading problem but even more so.

indeed -- does seem risky.

also, if were are in fantasy land, and want to be really newbie friendly, a new built in:

pip.install(PACKAGESPEC)

with no import required....

-CHB


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov