1. 使用source + 绝对路径 在脚本中的写法示例: source ~/anaconda3/bin/activate pytorch 这里按照你自己的安装路径写。我安装在了/home下 2. 运行脚本一定使用bash,source才可使用 示例: bash xxx.sh 不能使用 sh