我有多个conda
环保工作良好。当我尝试使用提交作业时qsub
对于上海金交所来说,.bashrc
文件未读取。批处理脚本如下所示:
#!/bin/bash
#$ -S /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
export OMP_NUM_THREADS=4
conda activate my_env
python ./test.py
我收到错误:conda: Command not found.
另外,它找不到像这样的 bash 命令export
.
source ~/.bashrc
or 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
在批处理脚本中。请帮忙。
编辑1:看到评论后
#!/bin/bash -l
#$ -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.