Pyenv-virtualenv: Clarify how to manage conda environments with older Python versions

Created on 21 Aug 2017  Â·  5Comments  Â·  Source: pyenv/pyenv-virtualenv

Right now pyenv allows installing miniconda and miniconda3, which assumes latest Python 2 (2.7.13) and Python 3 (3.6.2 at the time of writing). However, it is not clear what is the preferred way to manage conda environments that make use of older Python versions, for instance a conda environment with Python 3.5.

Most helpful comment

Related to this, *conda2 and *conda3 can both make python environments in python versions 2 and 3; both seem to default to py3.6. It would be helpful to be able to add arguments to pyenv virtualenv and pass them through to virtualenv/ conda env so that we could do pyenv virtualenv miniconda3-latest my-env python=2.7. Obviously it's possible to just activate the environment and change it there but it's not ideal or documented.

All 5 comments

I don't think there's anything that needs to be done. It just works.

before

$ pyenv shell miniconda3-4.1.11/envs/test
(test) (test) ✔ 17:48[vagrant@ubuntu-14:~] $ python --version
Python 3.6.2 :: Continuum Analytics, Inc.

change python

(test) (test) ✔ 17:48[vagrant@ubuntu-14:~] $ conda install python==3.5
Fetching package metadata .........
Solving package specifications: .

Package plan for installation in environment /home/vagrant/.pyenv/versions/miniconda3-4.1.11/envs/test:

The following packages will be UPDATED:

    pip:        9.0.1-py36_1  --> 9.0.1-py35_1
    setuptools: 27.2.0-py36_0 --> 27.2.0-py35_0
    wheel:      0.29.0-py36_0 --> 0.29.0-py35_0

The following packages will be DOWNGRADED due to dependency conflicts:

    python:     3.6.2-0       --> 3.5.0-1
    xz:         5.2.3-0       --> 5.0.5-1

Proceed ([y]/n)? y

after

(test) (test) ✔ 17:48[vagrant@ubuntu-14:~] $ python --version
Python 3.5.0 :: Continuum Analytics, Inc.

I don't think there's anything that needs to be done. It just works.

My point here is that this is not the typical conda usage. I have been using it since the beginning and never changed the Python version of an environment - it might be a personal thing of course, but perhaps adding this bit to the docs would ease adoption.

My point here is that this is not the typical conda usage.

I don't think that's a true statement, I do it all the time and conda allows you to seamlessly upgrade/downgrade.

I have been using it since the beginning and never changed the Python version of an environment

I think that's more of a "you" thing than a "conda" thing.

This entire topic is also more of a conda thing than a pyenv thing. ¯_(ツ)_/¯

I'll let the mods decide.

I think that's more of a "you" thing than a "conda" thing.

Fair enough, point taken.

Related to this, *conda2 and *conda3 can both make python environments in python versions 2 and 3; both seem to default to py3.6. It would be helpful to be able to add arguments to pyenv virtualenv and pass them through to virtualenv/ conda env so that we could do pyenv virtualenv miniconda3-latest my-env python=2.7. Obviously it's possible to just activate the environment and change it there but it's not ideal or documented.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oblitum picture oblitum  Â·  11Comments

dimaqq picture dimaqq  Â·  7Comments

woshihuangshuai picture woshihuangshuai  Â·  5Comments

jackmaney picture jackmaney  Â·  7Comments

melentye picture melentye  Â·  7Comments