Re: [sage-windows] Re: gtalk chat request

64 views
Skip to first unread message

William Stein

unread,
Jun 4, 2009, 11:42:12 AM6/4/09
to bill pines, sage-windows, sympy
2009/6/4 bill pines <bill...@gmail.com>:
> I am wondering if matplotlib working on windows port of sage, examples?

Yes. Though I think we currently build it with no GUI backends, so
you can create plots, but you can only render them to PNG's. (You use
savefig, I think.) It would be nice for a windows guru to fix things
so that a GUI backend works. Presumably windows has a windowing
library that works out of the box everywhere! :-).

As far as I can tell, sympy, scipy, and numpy all work perfectly in
sage-windows.
Sympy gets you pretty far for symbolic computation. If you try

import sympy
sympy.<tab key>

you'll see it has a lot of symbolic manipulation capabilities. It
also has a plot command which does both 2d and 3d plots and works
perfectly under windows.

William

>
> On Wed, Jun 3, 2009 at 3:50 PM, William Stein <wst...@gmail.com> wrote:
>>
>> On Wed, Jun 3, 2009 at 12:43 PM, Blair Sutton <bla...@googlemail.com> wrote:
>> > Oh right. Usually best to ask at google groups
>> > (http://groups.google.co.uk/group/sage-windows).
>> >
>> > Right now Sage-Windows is fairly basic and only the IPython shell with some
>> > math libraries is installed. We intend to update the distribution gradually.
>> >
>> > I expect that by version 0.40 we should have a system similar in usability
>> > to the UNIX port although perhaps lacking super computational power.
>>
>> I think it is impossible to tell how long until we'll be done.  E.g.,
>> we had no clue
>> how long it would take to get PARI running with MSVC, except that Dan
>> Shumow said he
>> tried for a few hours and "it didn't work".  Then we tried again
>> during Sage Days for about 2 hours,
>> and everything nicely fell into place and it works well.    I think it
>> is basically impossible to predict
>> how long it will take to get any component of sage to build with MSVC,
>> and the best we can do is
>> to just try.   Just over half the components of Sage are in sage-windows.
>>
>> William
>>
>>
>> >
>> > I have CCed this to the main list for future readers.
>> >
>> > On Wed, Jun 3, 2009 at 8:36 PM, bill pines <bill...@gmail.com> wrote:
>> >>
>> >> I want to ask question about sage, I could not run 0.37 on vista. I only
>> >> got ipython shell, do not know how to start sage. But no people answer my
>> >> question.
>
>

--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

Ondrej Certik

unread,
Jun 4, 2009, 12:21:12 PM6/4/09
to sage-w...@googlegroups.com, bill pines, sympy
On Thu, Jun 4, 2009 at 9:42 AM, William Stein <wst...@gmail.com> wrote:
>
> 2009/6/4 bill pines <bill...@gmail.com>:
>> I am wondering if matplotlib working on windows port of sage, examples?
>
> Yes.  Though I think we currently build it with no GUI backends, so
> you can create plots, but you can only render them to PNG's.  (You use
> savefig, I think.)   It would be nice for a windows guru to fix things

Unfortunately, this doesn't work, at least for me:

In [6]: pylab.savefig("C:\Users\Ondrej\Desktop\a.png")
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
[...]
C:\Program Files\Sage Math\local\python\lib\site-packages\matplotlib\backends\ba
ckend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
326 renderer.dpi = self.figure.dpi
327 if is_string_like(filename_or_obj):
--> 328 filename_or_obj = file(filename_or_obj, 'wb')
329 _png.write_png(renderer._renderer.buffer_rgba(0, 0),
330 renderer.width, renderer.height,

IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\Ondrej\\Desktop
\x07.png'

but the path is correct as checked by:

In [15]: os.system("dir "+"C:\Users\Ondrej\Desktop")
Volume in drive C has no label.
Volume Serial Number is AC4D-7A9B

Directory of C:\Users\Ondrej\Desktop

06/04/2009 09:47 AM <DIR> .
06/04/2009 09:47 AM <DIR> ..
06/03/2009 01:47 AM 72,169,316 sage-0.3.7.RC2.msi
06/04/2009 09:47 AM <DIR> sage-windows-0.3.7.RC2
06/04/2009 08:15 AM 67,843,793 sage-windows-0.3.7.RC2.zip
2 File(s) 140,013,109 bytes
3 Dir(s) 10,902,740,992 bytes free
Out[15]: 0


But python doesn't allow me to open any file in there in the write mode:

In [16]: open("C:\Users\Ondrej\Desktop\a.txt", "w")
---------------------------------------------------------------------------
IOError Traceback (most recent call last)

C:\Program Files\Sage Math\<ipython console> in <module>()

IOError: [Errno 22] invalid mode ('w') or filename: 'C:\\Users\\Ondrej\\Desktop\
x07.txt'

Thus matplotlib also fails.


> so that a GUI backend works.  Presumably windows has a windowing
> library that works out of the box everywhere! :-).

Yeah, that'd be awesome.

>
> As far as I can tell, sympy, scipy, and numpy all work perfectly in
> sage-windows.
> Sympy gets you pretty far for symbolic computation.  If you try
>
> import sympy
> sympy.<tab key>
>
> you'll see it has a lot of symbolic manipulation capabilities.  It
> also has a plot command which does both 2d and 3d plots and works
> perfectly under windows.

That's right, nice. Unfortunately no one has worked on the pyglet
based plotting in sympy for almost 2 years already.

I still hope someone will show up and port it as a matplotlib backend. :)

Ondrej

Robert Kern

unread,
Jun 4, 2009, 1:31:18 PM6/4/09
to sy...@googlegroups.com
On Thu, Jun 4, 2009 at 11:21, Ondrej Certik <ond...@certik.cz> wrote:
>
> On Thu, Jun 4, 2009 at 9:42 AM, William Stein <wst...@gmail.com> wrote:
>>
>> 2009/6/4 bill pines <bill...@gmail.com>:
>>> I am wondering if matplotlib working on windows port of sage, examples?
>>
>> Yes.  Though I think we currently build it with no GUI backends, so
>> you can create plots, but you can only render them to PNG's.  (You use
>> savefig, I think.)   It would be nice for a windows guru to fix things
>
> Unfortunately, this doesn't work, at least for me:
>
> In [6]: pylab.savefig("C:\Users\Ondrej\Desktop\a.png")
> ---------------------------------------------------------------------------
> IOError                                   Traceback (most recent call last)
> [...]
> C:\Program Files\Sage Math\local\python\lib\site-packages\matplotlib\backends\ba
> ckend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
>    326         renderer.dpi = self.figure.dpi
>    327         if is_string_like(filename_or_obj):
> --> 328             filename_or_obj = file(filename_or_obj, 'wb')
>    329         _png.write_png(renderer._renderer.buffer_rgba(0, 0),
>    330                        renderer.width, renderer.height,
>
> IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\Ondrej\\Desktop
> \x07.png'

Watch your backslashes! \a is the bell character.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco

Ondrej Certik

unread,
Jun 4, 2009, 1:40:23 PM6/4/09
to sy...@googlegroups.com
On Thu, Jun 4, 2009 at 11:31 AM, Robert Kern <rober...@gmail.com> wrote:
>
> On Thu, Jun 4, 2009 at 11:21, Ondrej Certik <ond...@certik.cz> wrote:
>>
>> On Thu, Jun 4, 2009 at 9:42 AM, William Stein <wst...@gmail.com> wrote:
>>>
>>> 2009/6/4 bill pines <bill...@gmail.com>:
>>>> I am wondering if matplotlib working on windows port of sage, examples?
>>>
>>> Yes.  Though I think we currently build it with no GUI backends, so
>>> you can create plots, but you can only render them to PNG's.  (You use
>>> savefig, I think.)   It would be nice for a windows guru to fix things
>>
>> Unfortunately, this doesn't work, at least for me:
>>
>> In [6]: pylab.savefig("C:\Users\Ondrej\Desktop\a.png")
>> ---------------------------------------------------------------------------
>> IOError                                   Traceback (most recent call last)
>> [...]
>> C:\Program Files\Sage Math\local\python\lib\site-packages\matplotlib\backends\ba
>> ckend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
>>    326         renderer.dpi = self.figure.dpi
>>    327         if is_string_like(filename_or_obj):
>> --> 328             filename_or_obj = file(filename_or_obj, 'wb')
>>    329         _png.write_png(renderer._renderer.buffer_rgba(0, 0),
>>    330                        renderer.width, renderer.height,
>>
>> IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\Ondrej\\Desktop
>> \x07.png'
>
> Watch your backslashes! \a is the bell character.

Right, William just pointed out on the sage-windows list too. It was
my fault, I have to learn how things work in windows. But windows7 is
pretty cool, it looks quite nice.

Ondrej

Reply all
Reply to author
Forward
0 new messages