Search code examples
jenkinspylint

pylint command not found on jenkins ci


cd $WORKSPACE
pylint --generate-rcfile > pylint.cfg
pylint --rcfile=pylint.cfg $1 > pylint.html   --output-format=$2
exit 0

To configure jenkins and pylint, i write the shell script above.They are the basic commands to create pylint.html file.When i try to run this commands on terminal, pylint.html file is created but with jenkins it returns:

line 2: pylint: command not found
line 4: pylint: command not found 

pylint 1.4.0 is installed on VM which Jenkins runs on.


Solution

  • I suspect your pylint utility not well configured but as an workaround, you can always provide the full path to force jenkins to recognize this command, for example:

    cd $WORKSPACE
    /usr/local/bin/pylint --generate-rcfile > pylint.cfg
    /usr/local/bin/pylint --rcfile=pylint.cfg $1 > pylint.html   --output-format=$2
    exit 0