Been trying awhile, read as much as
I can (all FAQs, README’s, etc), and need help. Basically I cannot get the
‘import Gnuplot” statement to work in a python script. Details as
follows.
Working in Windows XP
professional.
Installed gnuplot.py 1.8, by
unzipping to a directory, and from that directory
running:
python setup.py
install
When running the setup, got a
warning about “licence” being deprecated in favor of “license”; but everything
seems to have installed/copied OK.
Have the following directory in
place now (with the proper capital “G” which was a problem for
some):
C:\Program
Files\Python26\Lib\site-packages\Gnuplot
Editted the gp_win32.py file to
point to where pgnuplot.exe is located on my
PC.
Ran all the demo scripts, and got
all the demo graphs properly. Assuming gnuplot and numpy installed
correctly.
Added the sitepackages directory to
my PATH.
My problem is that when I run a
python script that tries to “import Gnuplot” it gets an error. For instance my
gpxplot.py script prints out this after trying to import
Gnuplot.
gnuplot.py is not
found
Exception AttributeError:
"GnuplotProcess instance has no attribute 'gnuplot'" in <bound method
GnuplotProcess.__del__ of <Gnuplot.gp_win32.GnuplotProcess instance at
0x0127C170>> i
Exception AttributeError: "Gnuplot
instance has no attribute 'gnuplot'" in <bound method Gnuplot.__del__ of
<Gnuplot._Gnuplot.Gnuplot instance at 0x0127C148>>
ignored
Did some additional reading about
python installs, and found that often a *.pth file is required to specify the
path to the directory which contains the module, so following the conventions of
some other packages I have installed, I created a Gnuplot.pth file in the
site-packages directory with a single line as follows (since the paths seem to
be relative to the directory the .pth file is
in):
Gnupath
Still no luck. The “import Gnuplot”
still fails.
Anyone got any ideas? Even if it is
next steps for debug, which I suspect needs to be around the area of how python
locates modules in files on disk (I am not a Python expert)
…
Here is the gpxplot.py script, the
failing import is in the plot_in_gnuplot
function.
http://gpxplot.googlecode.com/svn/trunk/gpxplot.py
Any help
appreciated.
…
Brian
|