4

I have Gnuplot 4.2 patchlevel 6 installed on my Centos 6 system. However, whenever I try importing Gnuplot in the python terminal, I get an error message which says that there is no module named Gnuplot:

'>>> import Gnuplot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Gnuplot`

Please help. Thanks.

aman
  • 121
  • 1
  • 4
  • 12
  • Python version is 2.6.6 – aman Apr 03 '15 at 09:52
  • what do you get by checking the paths? http://stackoverflow.com/a/9462280/2375207 – nicolallias Apr 03 '15 at 09:58
  • ['', '/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/gst-0.10', '/usr/lib/python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages/webkit-1.0'] – aman Apr 03 '15 at 10:02
  • 2
    how did you install it? – Padraic Cunningham Apr 03 '15 at 10:03
  • 1
    Try installing this python-gnuplot – Sagar Apr 03 '15 at 10:05
  • and then, check if gnuplot is in any of your paths, in bash something like for p in '/usr/lib/python26.zip', ...; do echo $p ; grep -r Gnuplot $p; done – nicolallias Apr 03 '15 at 10:10
  • nicolallias, i could not follow what you're asking me to do. could you please explain in detail? – aman Apr 03 '15 at 10:13
  • I was suggesting to look for gnuplot in these folders using a shell command. – nicolallias Apr 03 '15 at 12:08

3 Answers3

4
pip install gnuplot-py

didnot worked for me

Collecting gnuplot-py
Could not find a version that satisfies the requirement gnuplot-py (from versions: )
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external gnuplot-py to allow).
No matching distribution found for gnuplot-py

but following did the job:

wget http://downloads.sourceforge.net/project/gnuplot-py/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz
tar xzf gnuplot-py-1.8.tar.gz
cd gnuplot-py-1.8/
python setup.py install
Samsky
  • 438
  • 5
  • 11
3

try:

pip install gnuplot-py

If it does not work, try downloading the package from http://gnuplot-py.sourceforge.net/ and install it.

flycee
  • 11,948
  • 3
  • 19
  • 14
0

The easiest solution would be to

  1. Clone:

    git clone https://github.com/jrk/gnuplot-py into the site-packages

  2. Go to the installed directory use:

    python setup.py install

Susa
  • 361
  • 4
  • 9