我有多个
conda
环境运行良好。当我尝试使用 qsub
向 SGE 提交作业时,未读取 .bashrc
文件。批处理脚本如下所示:
#!/bin/bash
#$ -cwd
#$ -l h_cpu=48:00:00
#$ -l h_vmem=2048M
#$ -q pascal@pascal-[0123]-0[01234567]
## allocate the number of cores:
#$ -pe mpi 1
setenv OMP_NUM_THREADS 1
conda activate my_env
python ./test.py
我收到错误:
conda: Command not found.
此外,它找不到像 export
. 这样的 bash 命令
source ~/.bashrc
或 source ~/.bash_profile
没有帮助。
如果我使用
qsub -V ....
,代码会以某种方式运行,但它说
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
但是,由于一些外部原因,我不想使用
qsub -V
。
我是这个集群的新手,所以我一无所知。我只是希望能够在批处理脚本中的不同
conda enviroments
之间自由选择。请帮助。