[Distutils] Module Installation Issues

Nick Coghlan ncoghlan at gmail.com
Wed Sep 14 08:31:27 EDT 2016

On 14 September 2016 at 21:43, Donald Stufft <donald at stufft.io> wrote:
>> On Sep 13, 2016, at 7:06 PM, Steve Dower <steve.dower at python.org> wrote:
>> This is exactly the argument I was expecting when I said "those who want it to be perfect in every scenario"
> FWIW I don’t have a strong feeling on whether we should add it or not. I haven’t been a beginner in a long time and I am not very good at putting myself in their shoes. I legitimately don’t know what would be more or less confusing here, possible weird state (with or without a warning that they might be getting into weird state territory) or an error message telling them to use a real shell and not the Python REPL.

I think they're both confusing, but one of them we can be more certain
the user will have the ability to resolve, regardless of their
computing background.

Specifically, someone already familiar with the difference between a
system shell and the Python REPL isn't likely to make the mistake in
question in the first place - "$ pip install name" is clearly a shell
command *if* you know what the "$" indicates, while the unqualified
"pip install name" used in Warehouse for cross-platform consistency
still looks more like a system command than it does a Python
expression (it would be a potentially valid function call in some
other languages though, most notably MATLAB in the context of this

For someone that *doesn't* know the difference though, the only thing
we can be sure of is that they know how to run a Python REPL, and
hence presumably how to stop and restart that REPL. It's also the case
that for through-the-browser development, the user may not have system
shell access at all, even if they do already know the difference
between the two environments.

So if we're able to emit a warning that says "NOTE: Updated package
installed for already loaded module '<name>'. Restart Python to load
the new version.", then novice users are likely to take us at our word
and restart Python. Intermediate users may say "Hah, I know
imp.reload(), so I can ignore that warning!" and try to selective
reload things. Experienced users more familiar with what a debugging
nightmare selective reloading can be with a deep module dependency
tree and usage of the "from X import Y" early binding syntax may then
end up going back to just restarting their REPL session after
installing new things :)


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Distutils-SIG mailing list