dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

python job can not work in verison 1.0.2

Open leiruiqi opened this issue 7 years ago • 2 comments

python job execute error “command not found”

protected String commandType() {

        String envPath = System.getProperty("user.dir") + Constants.SINGLE_SLASH + "conf"+
                Constants.SINGLE_SLASH +"env" + Constants.SINGLE_SLASH + Constants.ESCHEDULER_ENV_SH;
        String pythonHome = getPythonHome(envPath);
        if (StringUtils.isEmpty(pythonHome)){
            return PYTHON;
        }
        return pythonHome;
    }

  1. The return value is "pythonHome" not the real python command path.
while ((line = br.readLine()) != null){
                if (line.contains(Constants.PYTHON_HOME)){
                    sb.append(line);
                    break;
                }
            }
  1. And the method getPythonHome(envPath) implements maybe have a little problem. to read a shell file and find the line contains "PYTHON_HOME". It maybe find the line like "## PYTHON_HOME=xxx "

leiruiqi avatar May 19 '19 03:05 leiruiqi

oh, really not very rigorous thank you,and I think you could submit a pull request to fix this problem, the steps like this: https://github.com/analysys/EasyScheduler/wiki/EasyScheduler%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81%E6%B5%81%E7%A8%8B

Very welcome for contribute related code! and we have developers group, would you like to join?

DanielLeens avatar May 19 '19 04:05 DanielLeens

1, you need to configure export PYTHON_HOME=/opt/Python-3.7.0/python in conf/env. Configure your Python absolute path, not PYTHON_HOME. If not, take the default python. Because it is considered that not all PYTHON_HOME is python below, it may be PYTHON_HOME/bin/python, or so on. 2, we have a configuration format, it is best to fill in our format


1,需要在conf/env中配置 export PYTHON_HOME=/opt/Python-3.7.0/python。配置你的Python绝对路径,不是PYTHON_HOME。如果没有,则走默认的python。 因为考虑到不一定所有的PYTHON_HOME下面都是python,也可能是PYTHON_HOME/bin/python,或者等等。 2,我们有配置格式,最好按照我们的格式填写

qiaozhanwei avatar May 20 '19 07:05 qiaozhanwei