pyenv-virtualenv: version `myvenv' is not a virtualenv

Created on 4 Jul 2018  Â·  9Comments  Â·  Source: pyenv/pyenv-virtualenv

When I create a venv like this:

$ pyenv virtualenv python_version myvenv
e.g. python_version: anaconda3-5.2.0

and try to activate the venv with either:

$ pyenv activate myvenv
or

$ source activate myvenv
I get this error:

pyenv-virtualenv: version `myvenv' is not a virtualenv

When I do
$ conda info --envs
venv appears with the full path but its name (myvenv) is empty.

I can still activate it by using the full path but it was working fine just with the name before. I have no idea why it doesn't work anymore.

EDIT:
Now it doesn't work with the full path either.
This doesn't work too:
$ pyenv activate anaconda3-5.2.0/envs/myenv

EDIT 2:
I tried to create a new venv with conda like this:
conda create -n myenv anaconda=5.2.0
and the venv now appears normally with
$ conda info --envs
and gets activated normally with:
conda activate myenv

Most helpful comment

I found the correct way to use pyenv manage anaconda.

Install anaconda using pyenv.

pyenv install anaconda-xxx

Then activate anaconda environment. DO NOT use pyenv virtualenv anaconda xxx to create virtualenv. Just do this:

pyenv activate anaconda-xxx

Now, you can use conda to create virtualenv:

conda create -n myenv python=3.6
conda activate myenv
conda deactivate

I guess that pyenv can no longer directly manage the virtualenv of anaconda. So we have to activate anaconda env first, and then use conda to manage anaconda virtualenv.

It works for me. Hope it helps you.

But I still like the old way. :<

All 9 comments

I am having very similar problems. I'll see if the conda create -n myenv anaconda=5.2.0 works

I was having the same problem, what actually worked for me was just updating the following git repos

~/.pyenv --> git pull origin master
~/.pyenv/plugins/pyenv-installer --> git pull origin master
~/.pyenv/plugins/pyenv-virtualenv --> git pull origin master

@jesuslemus : didn't work for me.

I found the correct way to use pyenv manage anaconda.

Install anaconda using pyenv.

pyenv install anaconda-xxx

Then activate anaconda environment. DO NOT use pyenv virtualenv anaconda xxx to create virtualenv. Just do this:

pyenv activate anaconda-xxx

Now, you can use conda to create virtualenv:

conda create -n myenv python=3.6
conda activate myenv
conda deactivate

I guess that pyenv can no longer directly manage the virtualenv of anaconda. So we have to activate anaconda env first, and then use conda to manage anaconda virtualenv.

It works for me. Hope it helps you.

But I still like the old way. :<

I found the correct way to use pyenv manage anaconda.

Install anaconda using pyenv.

pyenv install anaconda-xxx

Then activate anaconda environment. DO NOT use pyenv virtualenv anaconda xxx to create virtualenv. Just do this:

pyenv activate anaconda-xxx

Now, you can use conda to create virtualenv:

conda create -n myenv python=3.6
conda activate myenv
conda deactivate

I guess that pyenv can no longer directly manage the virtualenv of anaconda. So we have to activate anaconda env first, and then use conda to manage anaconda virtualenv.

It works for me. Hope it helps you.

But I still like the old way. :<

I found the correct way to use pyenv manage anaconda.

Install anaconda using pyenv.

pyenv install anaconda-xxx

Then activate anaconda environment. DO NOT use pyenv virtualenv anaconda xxx to create virtualenv. Just do this:

pyenv activate anaconda-xxx

Now, you can use conda to create virtualenv:

conda create -n myenv python=3.6
conda activate myenv
conda deactivate

I guess that pyenv can no longer directly manage the virtualenv of anaconda. So we have to activate anaconda env first, and then use conda to manage anaconda virtualenv.

It works for me. Hope it helps you.

But I still like the old way. :<

I am thinking why I need pyenv-virtualenv? It seems that I just need pyenv + conda?

same issue here

same issue here

EDIT 2: works for me. The following works also.

  • conda create -n myenv anaconda=5.2.0 python=3.7

    • pyenv activate myenv

I've done as follows which is similar to @TitorX 's recommendation but to use with pyenv-virtualenv.

Create a conda environment within anaconda3 activated status.

# set pyenv global with anaconda3. 
$ pyenv global anaconda3-5.3.1 

# create a conda env
(anaconda3-5.3.1) $ conda create -n test-conda-env python=3.7

# restore global env to exit from the anaconda3 env
(anaconda3-5.3.1) $ pyenv global system

Create virtualenv with the created environment.

# create virtualenv with the created conda env
$ pyenv virtualenv anaconda3-5.3.1/envs/test-conda-env test-conda-env

# set local env (as default env in the current path)
$ pyenv local test-conda-env

Now the conda environment is automatically activated whenever you visit the path. But you should manually activate the newly created conda environment within the path :(

(test-conda-env) $ conda activate test-conda-env
(test-conda-env) (test-conda-env) $
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Insoleet picture Insoleet  Â·  3Comments

andymccurdy picture andymccurdy  Â·  9Comments

tmoschou picture tmoschou  Â·  9Comments

f8ttyc8t picture f8ttyc8t  Â·  7Comments

oblitum picture oblitum  Â·  11Comments