0

The following lines were added to my .bashrc :

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

The following lines in the terminal illustrates the problem:

cardamom@neptune ~ $ mkdir testDirectory
cardamom@neptune ~ $ cd testDirectory
cardamom@neptune ~/testDirectory $ pyenv versions
* system (set by /home/felix/.pyenv/version)
  3.4.3
  3.5.0
  project1
  miniconda2-latest
  miniconda3-latest
  miniconda3-latest/envs/project1
cardamom@neptune ~/testDirectory $ pyenv local miniconda3-latest
(miniconda3-latest) cardamom@neptune ~/testDirectory $ pyenv local miniconda2-latest
(miniconda2-latest) cardamom@neptune ~/testDirectory $ pyenv local 3.4.3
cardamom@neptune ~/testDirectory $ python --version
Python 3.4.3
cardamom@neptune ~/testDirectory $

Does anyone know what is wrong and how to fix it?

cardamom
  • 6,873
  • 11
  • 48
  • 102

1 Answers1

1

Because miniconda3-latest is a virtual environment, and 3.4.3 is just a different Python version.

pyenv, which is used to change current active Python version, isn't changing commandline prompt in any way, but pyenv-virtualenv plugin does.

There is nothing wrong with it, it's just virtualenvs get special treatment in this situation.

leovp
  • 4,528
  • 1
  • 20
  • 24
  • Thanks. I wonder why someone told me then to install `pyenv` instead of `pyenv-virtualenv` if the latter sounds more fully featured. Is that the case or are they for different purposes? – cardamom Mar 16 '17 at 12:08
  • 1
    Of course. Generally you need both. `pyenv` is for switching Python versions, and `pyenv-virtualenv` is a plugin for isolating projects and their dependencies. – leovp Mar 16 '17 at 12:45