I want to import an existing virtual env, which I created using anaconda into another anaconda installation on a different distribution.
I've tried creating a new one using the following command in the directory of the venv copied from the other distribution:
conda create -p . python=3.4
That results in:
Error: prefix already exists: /home/xiaolong/development/blog
But anaconda does not know that, when I ask it to list all existing venvs:
conda info --envs
This results in:
# conda environments:
#
firstenv /home/xiaolong/development/anaconda3/envs/firstenv
gtkplus-tool /home/xiaolong/development/anaconda3/envs/gtkplus-tool
testenv /home/xiaolong/development/anaconda3/envs/testenv
tkxld /home/xiaolong/development/anaconda3/envs/tkxld
wxpython-phoenix-tutorial /home/xiaolong/development/anaconda3/envs/wxpython-phoenix-tutorial
root * /home/xiaolong/development/anaconda3
This list is missing my copied venv. How do I add it to that list, so that I can then use source activate blog for example?
解决方案
-p . cannot work because the directory must not exist already.
You probably want your env in /home/xiaolong/development/blog/env or something similar. So just do conda create -p ./env python=3.4.