PyGnuplot icon indicating copy to clipboard operation
PyGnuplot copied to clipboard

if gunplot is not installed, you get a cryptic error message

Open mepster opened this issue 4 years ago • 1 comments

First of all, thanks for the awesome library PyGnuplot!

I got a cryptic error message upon starting python (2.7) and trying to "import PyGnuplot":

$ python Python 2.7.13 (default, Aug 22 2020, 10:03:02) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import PyGnuplot Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python2.7/site-packages/PyGnuplot.py", line 112, in fl = _FigureList() File "/home/pi/.local/lib/python2.7/site-packages/PyGnuplot.py", line 30, in init proc = _Popen(['gnuplot', '-p'], shell=False, stdin=_PIPE, universal_newlines=True) # persitant -p File "/usr/lib/python2.7/subprocess.py", line 390, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

Not a very informative error message, right? It turned out (after I did a lot of head scratching and searching the internet) that the problem was that gnuplot itself was not installed on my machine! (It's a raspberry pi running Linux 4.19.66-v7+ ) Installing gnuplot fixed it.

I know this is not really the fault of PyGnuplot per se, but it could save some more head scratching by others if PyGnuplot checked that the gnuplot binary was installed and accessible. :-)

Or, hopefully if I put the error message here others will find it.

Thanks again for the great library.

mepster avatar Sep 11 '20 19:09 mepster

Thanks for the note, I think this helps!

benschneider avatar Apr 10 '21 08:04 benschneider