Pipenv: Allow specifying arbitrary Python versions/executables

Created on 26 Jan 2017  路  9Comments  路  Source: pypa/pipenv

E. g. with the -p/--python flag like one we have in Virtualenv:

pipenv -p python3.6

Right now it can be done by manually creating a .venv before using pipenv:

virtualenv -p python3.6 .venv
pipenv

Most helpful comment

@iamale I highly recommend using pyenv to manage and select between multiple versions of Python.

All 9 comments

i like only having two/three specifiable right now. I will think about it, though.

Please do.

One problem with two/three switch only is that sometimes python3 doesn't point to the latest Python 3 version available (for example, on my system /usr/bin/python3 links to /usr/bin/python3.4 even though I have 3.5 and 3.6 as well).

sounds like you should fix your setup :D

I don't disagree, though. I just really like the simplicity of the current setup.

If anything, having an extra --venv-params argument is a possibility, but i'd much rather get away with what we're doing now and force people to improve their setups.

@iamale I highly recommend using pyenv to manage and select between multiple versions of Python.

Mucking around with the default system-wide python version is a good way to break random distro stuff though, even if it's only mucked up for the current user. In #python at least, we strongly discourage people from doing that just due to the random breakage of unrelated things it can cause.

A somewhat related note, it'd be really handy to be able to have multiple venvs for a project, for different python interpreters; there isn't always a CI tool involved, and a lot of the benefits of pipenv seem to disappear once you start trying to work with multiple interpreters.

pipenv seems to support specifying arbitrary Python executables using the --python flag. Multiple venvs would be really nice, though.

pew, that we now use by default for environment management, has the ability to associate multiple virtualenvs with a single project. It looks like we may have not exposed an interface in pipenv to manage this without running pew commands but I'm not positive. This functionality was implemented by @kennethreitz, so he'll have a better idea.

If it's not currently available, this is likely something we can look into exposing via a pipenv command.

Only plans to support one at a time at this time.

Was this page helpful?
0 / 5 - 0 ratings