[Python-ideas] Looking for input to help with the pip situation

Paul Moore p.f.moore at gmail.com
Wed Nov 15 04:51:42 EST 2017


On 15 November 2017 at 08:22, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 15 November 2017 at 16:13, Steve Barnes <gadgetsteve at live.co.uk> wrote:
>>
>>   - "pip -X[.Y][-32|-64] operation ..." tries to find a python matching
>> -X[.Y][-32|-64] and if it succeeds executes "python -m pip operation
>> ..." with that python, (if it doesn't find a matching python is should
>> fail with a sensible error message and possibly list the valid python
>> specifiers).
>
>
> This is a genuinely interesting option, especially as `pipenv` has already
> implemented a feature somewhat akin to this:
> https://docs.pipenv.org/basics.html#specifying-versions-of-python
>
> `pipenv` also allows `pipenv --two` and `pipenv --three` when setting up
> your initial virtual environment.

This is an interesting idea for *any* tool that's about "working with
Python environments" as opposed to "writing Python code". So pip,
virtualenv, tox, pipenv, ... Many of these tools are variously
reinventing "tell me which Python environment to work on" options.
Having a common way to do this would be really useful. I'm not sure
how likely it would be for pip to be able to use it (pip introspects
sys.executable to get site-packages, etc), but it's certainly a
possibility.

Having a standardised library/wrapper that handles the "select a
Python environment" process would be a huge plus. There's
https://github.com/zooba/pep514tools which is a start on handling the
Windows registry scanning logic, and building on that to include Unix
and anything else we needed would be great.

Paul


More information about the Python-ideas mailing list