Linux Conda 使用activate无法进入环境,但list中有环境的路径

安装OpenFace时装了个miniconda,之后就进不去anaconda的其它环境了:

(pfld) 。。。。。$ conda env list
# conda environments:
#
                         /home/deeplearning/anaconda3/home/deeplearning/anaconda3/envs/common/home/deeplearning/anaconda3/envs/openface
                         /home/deeplearning/anaconda3/envs/pfld
                         /home/deeplearning/anaconda3/envs/public_env
                         。。。。。。
base                     /home/deeplearning/miniconda3
pfld                  *  /home/deeplearning/miniconda3/envs/pfld

(pfld) 。。。。。$ conda activate public_env

EnvironmentNameNotFound: Could not find conda environment: public_env
You can list all discoverable environments with `conda info --envs`.

 

仔细看,左边这列的"base",指向miniconda,anaconda的环境都没了名字。说明当前正在miniconda中。

这时需要通过"activate [anaconda的环境路径]"和"source activate"回到anaconda:

(pfld) 。。。。。。$ conda activate /home/deeplearning/anaconda3
(/home/deeplearning/anaconda3) 。。。。。。$ source activate
(/home/deeplearning/anaconda3) 。。。。。。$ conda env list
# conda environments:
#
base                  *  /home/deeplearning/anaconda3
common                   /home/deeplearning/anaconda3/envs/common
openface                 /home/deeplearning/anaconda3/envs/openface
pfld                     /home/deeplearning/anaconda3/envs/pfld
public_env               /home/deeplearning/anaconda3/envs/public_env/home/deeplearning/miniconda3
                         /home/deeplearning/miniconda3/envs/pfld

可以看见anaconda环境的名字都回来了,而miniconda的环境名都消失了,这时便可以使用"conda activate <env_name>"跳转到anaconda的环境。

 

openface并不一定要miniconda,所以可以把它卸了:卸载miniconda

 

参考:conda环境名消失的解决办法

 

附:openface安装步骤

Step 1.

  Install miniconda with the following commands wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh and follow instructions. 

  Add a Python 2.7 environment with: conda create --name openface python=2.7 

  Activate the new env with: source activate openface

Step 2.

  Install dependencies Add the conda-forge channel with: conda config --add channels conda-forge conda install opencv numpy pandas scipy scikit-learn scikit-image dlib txaio twisted autobahn OpenSSL pyopenssl imagehash service_identity

Step 3.

  Install Torch and dependencies Deactivate the openface environment by opening a new terminal. git clone https://github.com/torch/distro.git ~/torch --recursive cd ~/torch; bash install-deps; ./install.sh *

  Execute the following to install the Torch deps for NAME in dpnn nn optim optnet csvigo cutorch cunn fblualib torchx tds; do luarocks install $NAME; done

Step 4.

  Install open face in openface environment using source activate openface git clone https://github.com/cmusatyalab/openface.git ~/openface cd openface python setup.py install *

  Download dlibs models with: ./models/get-models.sh

Open face is now installed. Test it with * ./demos/classifier.py infer models/openface/celeb-classifier.nn4.small2.v1.pkl ./images/examples/carell.jpg

热门相关:最强狂兵   第一神算:纨绔大小姐   豪门闪婚:帝少的神秘冷妻   薄先生,情不由己   网游之逆天飞扬