虚拟环境无法激活

时间:2020-03-10 13:47:37

标签: python anaconda virtualenv conda

我尝试使用bash脚本打开虚拟环境,但出现此错误:

./training_corpus1.sh: line 8: env/bin/activate: No such file or directory


bash脚本如下所示:


#!/usr/bin/env bash

set -e

cd /home/ge/ke/anaconda3/envs 

source env/bin/activate

cd ~/eXP/bert

CUDA_VISIBLE_DEVICES=0,1 python training.py \
    --exp_name bert \ ...

env目录如下:

(env) ke@dere2:~/anaconda3/envs$ ls
env  myenv
(env) ke@dere2:~/anaconda3/envs$ cd env

(env) ke@dere2:~/anaconda3/envs/env$ ls

bin              etc      man          qml        ssl
compiler_compat  include  mkspecs      resources  translations
conda-meta       lib      phrasebooks  sbin       var
doc              libexec  plugins      share      x86_64-conda_cos6-linux-gnu
(env) ke@dere2:~/anaconda3/envs/env$ cd bin
(env) ke@dere2:~/anaconda3/envs/env/bin$ ls
2to3                                fribidi                      jupyter-kernelspec                 pyami_sendmail           saved_model_cli
2to3-3.6                            futurize                     jupyter-lab                        pybabel          

0 个答案:

没有答案