在jenkins中运行python文件时遇到如下报错
但是我在shell的脚本中运行conda是完全没有问题的,但是在python文件放在jenkins中就会报错,网上说要jenkins中运行/etc/profile加载配置文件就可以了,照做,但还是Faild,因为加载配置文件失败。我的解决办法是在最前面加上
set +e
跳过所有错误,运行依然报错
然后我在/etc/profile.d/apps-bin-path.sh中添加了一个conda环境变量
成功读取环境变量conda
参考链接:
https://blog.51cto.com/u_15127514/2658384
https://www.it610.com/article/1225110211103133696.htm



