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

Posted ENIAC-Jushi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的环境。

 

参考:conda环境名消失的解决办法 (31条消息) conda环境名称消失问题_學霖的博客-CSDN博客_conda环境没有名字

 

附:openface安装步骤 Setup - OpenFace (cmusatyalab.github.io)

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

以上是关于Conda 使用activate无法进入环境,但list中有环境的路径的主要内容,如果未能解决你的问题,请参考以下文章

conda退出base 环境

解决powershell无法使用conda虚拟环境问题

安装conda后取消命令行前出现的base,取消每次启动自动激活conda的基础环境, 使用ubuntu 自带的Python环境

conda activate base调试的时候自动激活了虚拟环境的解决

使用conda管理python环境和包

conda查看创建删除激活退出环境