Search code examples
pythongitgnuplot

GitStats doesn't recognise Gnuplot (Windows)


I tried to set up GitStats but I can't seem to get it working on Windows 10 with Git Bash

I've added an environment variable to "C:\gnuplot\bin" for Gnuplot

Gnuplot installed:

$ gnuplot --version
gnuplot 5.2 patchlevel 7

GitStats:

$  python gitstats ../ ../stats/
'C:\gnuplot\bin' is not recognized as an internal or external command,
operable program or batch file.
[0.04700] >> C:\gnuplot\bin --version
gnuplot not found

How can I get it working?


Solution

  • The gitstats scripts includes:

    # By default, gnuplot is searched from path, but can be overridden with the
    # environment variable "GNUPLOT"
    gnuplot_cmd = 'gnuplot'
    if 'GNUPLOT' in os.environ:
        gnuplot_cmd = os.environ['GNUPLOT']
    

    That means you need to set GNUPLOT to the gnuplot executable, not its parent folder (bin).

    set GNUPLOT=C:\gnuplot\bin\gnuplot.exe