[Tutor] gnuplot.py installation and some general questions

Joshua Pollack jpollack@socrates.Berkeley.EDU
Fri, 27 Sep 2002 12:15:15 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_003C_01C2661F.89AC1250
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

I'm having trouble with my gnuplot.py installation under Windows XP.  It =
goes as follows (with some digressions as to general python =
questions..):

Here's what's happening.  I unzipped the gnuplot1.6 file into my
.\site-packages directory (same place Numeric automatically puts itself. =
 As
you suggested, I put pgnuplot.exe in \bin and added it to my PATH =
variable.
Do I have this straight?  The PATH variable allows you to call all of =
the
entities listed from anywhere on your computer, correct? (i.e.- I could =
call
python from c:\mystuff\shakespeare or whatever) and the PYTHONPATH =
variable
is all the places python looks for modules when you import them?  (is =
this
the same as sys.path?)  So anyway:

I do the little python setup.py install dance and get a load of output =
that
looks promising.  However when I import Gnuplot and assign a variable =
like
so: map=3DGnuplot.Gnuplot(debug=3D1) and then try and plot something, =
such as
sin(x) or something I get the following output:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in ?
    map('sin(x)')
  File "c:\Python22\Lib\site-packages\Gnuplot\_Gnuplot.py", line 206, in
__call__
    self.gnuplot(s)
  File "c:\Python22\Lib\site-packages\Gnuplot\gp_win32.py", line 122, in
__call__
    self.write(s + '\n')
IOError: [Errno 22] Invalid argument

I get some additional errors when I try and run it from the command line =
(I
ran this from the shell), but these two were ubiquitous.  It seems to =
have
something to do with the s variable in both functions, but as far as I =
can
tell, it's just an input string, both functions look correct.  Somehow, =
I'm
not sure my python is piping correctly to pgnuplot.exe.  Does putting it =
in
the \bin file and adding that to PATH take care of that?

Anyway, let me know if there's something obvious.

Thanks and have a good weekend.

Josh


------=_NextPart_000_003C_01C2661F.89AC1250
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm having trouble with my gnuplot.py =
installation=20
under Windows XP.&nbsp; It goes as follows (with some digressions as to =
general=20
python questions..):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>Here's what's happening.&nbsp; I unzipped the gnuplot1.6 file into=20
my<BR>.\site-packages directory (same place Numeric automatically puts=20
itself.&nbsp; As<BR>you suggested, I put pgnuplot.exe in \bin and added =
it to my=20
PATH variable.<BR>Do I have this straight?&nbsp; The PATH variable =
allows you to=20
call all of the<BR>entities listed from anywhere on your computer, =
correct?=20
(i.e.- I could call<BR>python from c:\mystuff\shakespeare or whatever) =
and the=20
PYTHONPATH variable<BR>is all the places python looks for modules when =
you=20
import them?&nbsp; (is this<BR>the same as sys.path?)&nbsp; So =
anyway:<BR><BR>I=20
do the little python setup.py install dance and get a load of output=20
that<BR>looks promising.&nbsp; However when I import Gnuplot and assign =
a=20
variable like<BR>so: map=3DGnuplot.Gnuplot(debug=3D1) and then try and =
plot=20
something, such as<BR>sin(x) or something I get the following=20
output:<BR><BR>Traceback (most recent call last):<BR>&nbsp; File=20
"&lt;pyshell#2&gt;", line 1, in ?<BR>&nbsp;&nbsp;&nbsp; =
map('sin(x)')<BR>&nbsp;=20
File "c:\Python22\Lib\site-packages\Gnuplot\_Gnuplot.py", line 206,=20
in<BR>__call__<BR>&nbsp;&nbsp;&nbsp; self.gnuplot(s)<BR>&nbsp; File=20
"c:\Python22\Lib\site-packages\Gnuplot\gp_win32.py", line 122,=20
in<BR>__call__<BR>&nbsp;&nbsp;&nbsp; self.write(s + '\n')<BR>IOError: =
[Errno 22]=20
Invalid argument<BR><BR>I get some additional errors when I try and run =
it from=20
the command line (I<BR>ran this from the shell), but these two were=20
ubiquitous.&nbsp; It seems to have<BR>something to do with the s =
variable in=20
both functions, but as far as I can<BR>tell, it's just an input string, =
both=20
functions look correct.&nbsp; Somehow, I'm<BR>not sure my python is =
piping=20
correctly to pgnuplot.exe.&nbsp; Does putting it in<BR>the \bin file and =
adding=20
that to PATH take care of that?<BR><BR>Anyway, let me know if there's =
something=20
obvious.<BR><BR>Thanks and have a good=20
weekend.<BR><BR>Josh<BR></DIV></BODY></HTML>

------=_NextPart_000_003C_01C2661F.89AC1250--