sagemath installs on ubuntu karmic, but abends on simple problem

15 views
Skip to first unread message

Tom Roche

unread,
Feb 13, 2010, 7:27:22 PM2/13/10
to sage-support
summary: I installed ubuntu package=sagemath (and dependencies) using
aptitude on 2 previously-sage-clean ubuntu karmic boxes. Sage appeared
to install cleanly on both boxes, but a simple problem (that works on
sagenb.org) causes sage to abend similarly on both boxes. How to fix
the current installs, or reinstall more appropriately?

details:

I'm trying to show my girlfriend's daughter how to do some simple math
on her computer. She has UNR 9.10 on i386, I have straight ubuntu 9.10
on amd64. Both are GNOME-based and have default python=2.6. I have
previously installed and used scipy/numpy on my box without problems;
her box is enthought-clean. Both of us are new to sage (I have used
Mathematica some, but only on windows) and both our boxes were
previously sage-clean.

I did one of her homework problems on the web:

http://www.sagenb.org/home/tlroche/0/
> x, y = var('x y')
> e1 = y == 2*x - 2
> e2 = y == x + 2
> solve([e1, e2], x, y)
and got as expected
> [[x == 4, y == 6]]

so I decided to install package=sagemath on her netbook, with

$ sudo aptitude install sagemath

using current default ubuntu repositories. This installed without
error. Since it was such a huge install (postfix?) I restarted
afterward. I then attempted to run the above example from the
commandline and failed miserably. Thinking it might be a box- or
architecture-specific problem, I then installed the same way on
my box and got a very similar error trace, which follows in its
entirety following my .sig.

I'm wondering, is there an easy way to fix these installs?
Alternatively, is there a better way to install sage on ubuntu?
Apologies if this is a FAQ: I saw a buncha posts about ubuntu install
problems, but nothing quite this uncomplicated (i.e. a straight/fresh
install of the sage packages).

Feel free to reply directly to me as well as to the group, and TIA,
Tom Roche <Tom_...@pobox.com>-----trace follows to end of post------

tlroche@tlrPanP5:~$ sage
----------------------------------------------------------------------
| SAGE Version 3.0.5, Release Date: 2008-07-11 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: x,y=var('x y')
sage: e1=y==2*x-2
Exception pexpect.EOF: EOF() in
'sage.structure.parent._unregister_pair' ignored
Maxima crashed -- automatically restarting.
Exception pexpect.EOF: EOF() in
'sage.structure.parent._unregister_pair' ignored
sage: e2=y==x+2
sage: solve([e1,e2],x,y)
Maxima crashed -- automatically restarting.
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (865, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (865, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (575, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (356, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (865, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (387, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (805, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (785, 0))

---------------------------------------------------------------------------
EOF Traceback (most recent call
last)

/home/tlroche/<ipython console> in <module>()

/usr/lib/python2.5/site-packages/sage/calculus/equations.pyc in
solve(f, *args, **kwds)
1378 return []
1379
-> 1380 m = maxima(list(f))
1381
1382 try:

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
__call__(self, x)
375 def __call__(self, x):
376 import sage.rings.all
--> 377 return Expect.__call__(self, x)
378
379 def __init__(self, script_subdirectory=None, logfile=None,
server=None,

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
__call__(self, x)
954 pass
955 try:
--> 956 return self._coerce_impl(x, use_special=False)
957 except TypeError, msg:
958 try:

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
_coerce_impl(self, x, use_special)
999 z.append(v)
1000 else:
-> 1001 w = self(v)
1002 A.append(w.name())
1003 z.append(w)

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
__call__(self, x)
375 def __call__(self, x):
376 import sage.rings.all
--> 377 return Expect.__call__(self, x)
378
379 def __init__(self, script_subdirectory=None, logfile=None,
server=None,

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
__call__(self, x)
948 return cls(self, x)
949 try:
--> 950 return self._coerce_from_special_method(x)
951 except TypeError:
952 raise

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
_coerce_from_special_method(self, x)
972 s = '_gp_'
973 try:
--> 974 return (x.__getattribute__(s))(self)
975 except AttributeError:
976 return self(x._interface_init_())

/usr/lib/python2.5/site-packages/sage/calculus/equations.pyc in
_maxima_(self, session)
569 return SageObject._maxima_(self,
sage.calculus.calculus.maxima)
570 else:
--> 571 return SageObject._maxima_(self, session)
572
573 def substitute(self, *args, **kwds):

/usr/lib/python2.5/site-packages/sage/structure/sage_object.so in
sage.structure.sage_object.SageObject._maxima_ (sage/structure/
sage_object.c:3076)()

/usr/lib/python2.5/site-packages/sage/structure/sage_object.so in
sage.structure.sage_object.SageObject._interface_ (sage/structure/
sage_object.c:2207)()

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
__call__(self, x)
375 def __call__(self, x):
376 import sage.rings.all
--> 377 return Expect.__call__(self, x)
378
379 def __init__(self, script_subdirectory=None, logfile=None,
server=None,

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
__call__(self, x)
946 return x
947 if isinstance(x, basestring):
--> 948 return cls(self, x)
949 try:
950 return self._coerce_from_special_method(x)

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
__init__(self, parent, value, is_name)
1212 else:
1213 try:
-> 1214 self._name = parent._create(value)
1215 except (TypeError, KeyboardInterrupt,
RuntimeError, ValueError), x:
1216 self._session_number = -1

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
_create(self, value)
1090 name = self._next_var_name()
1091 #self._last_name = name
-> 1092 self.set(name, value)
1093 return name
1094

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
set(self, var, value)
853 self._batch(cmd, batchload=True)
854 else:
--> 855 self._eval_line(cmd)
856 #self._sendline(cmd)
857 #self._expect_expr()

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_eval_line(self, line, allow_use_file, wait_for_prompt, reformat,
error_check)
559 return repr(a)
560 else:
--> 561 self._sendline(line)
562
563 if not wait_for_prompt:

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_sendline(self, str)
430
431 def _sendline(self, str):
--> 432 self._sendstr(str)
433 os.write(self._expect.child_fd, os.linesep)
434

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_sendstr(self, str)
435 def _sendstr(self, str):
436 if self._expect is None:
--> 437 self._start()
438 try:
439 os.write(self._expect.child_fd, str)

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_start(self)
420
421 def _start(self):
--> 422 Expect._start(self)
423 self._eval_line('0;')
424

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
_start(self, alt_message, block_during_init)
467 if block_during_init:
468 for X in self.__init_code:
--> 469 self.eval(X)
470 else:
471 for X in self.__init_code:

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
eval(self, code, strip, synchronize, **kwds)
915 try:
916 with gc_disabled():
--> 917 return '\n'.join([self._eval_line(L, **kwds)
for L in code.split('\n') if L != ''])
918 except KeyboardInterrupt:
919 # DO NOT CATCH KeyboardInterrupt, as it is being
caught

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_eval_line(self, line, allow_use_file, wait_for_prompt, reformat,
error_check)
564 return
565
--> 566 self._expect_expr(self._display_prompt)
567 self._expect_expr()
568 out = self._before()

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_expect_expr(self, expr, timeout)
455 i = self._expect.expect(expr,timeout=timeout)
456 else:
--> 457 i = self._expect.expect(expr)
458 if i > 0:
459 v = self._expect.before

/usr/lib/python2.5/site-packages/pexpect.pyc in expect(self, pattern,
timeout, searchwindowsize)
1309
1310 compiled_pattern_list =
self.compile_pattern_list(pattern)
-> 1311 return self.expect_list(compiled_pattern_list,
timeout, searchwindowsize)
1312
1313 def expect_list(self, pattern_list, timeout = -1,
searchwindowsize = -1):

/usr/lib/python2.5/site-packages/pexpect.pyc in expect_list(self,
pattern_list, timeout, searchwindowsize)
1323 self.searchwindowsize value is used. """
1324
-> 1325 return self.expect_loop(searcher_re(pattern_list),
timeout, searchwindowsize)
1326
1327 def expect_exact(self, pattern_list, timeout = -1,
searchwindowsize = -1):

/usr/lib/python2.5/site-packages/pexpect.pyc in expect_loop(self,
searcher, timeout, searchwindowsize)
1394 self.match = None
1395 self.match_index = None
-> 1396 raise EOF (str(e) + '\n' + str(self))
1397 except TIMEOUT, e:
1398 self.buffer = incoming

EOF: End Of File (EOF) in read_nonblocking(). Exception style
platform.
<pexpect.spawn object at 0x3eee3d0>
version: 2.3 ($Revision: 399 $)
command: /usr/bin/maxima
args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
maxima.lisp']
searcher: searcher_re:
0: re.compile("<sage-display>")
buffer (last 100 chars):
before (last 100 chars):
To reenable the Lisp debugger set *debugger-hook* to nil.
(%i2) xmalloc: out of virtual memory

after: <class 'pexpect.EOF'>
match: None
match_index: None
exitstatus: 2
flag_eof: True
pid: 3409
child_fd: 3
closed: False
timeout: None
delimiter: <class 'pexpect.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 10000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0
delayafterclose: 0.1
delayafterterminate: 0.1
sage:

Alex Ghitza

unread,
Feb 13, 2010, 10:07:47 PM2/13/10
to Tom Roche, sage-support
On Sat, 13 Feb 2010 16:27:22 -0800 (PST), Tom Roche <tlr...@gmail.com> wrote:
> summary: I installed ubuntu package=sagemath (and dependencies) using
> aptitude on 2 previously-sage-clean ubuntu karmic boxes. Sage appeared
> to install cleanly on both boxes, but a simple problem (that works on
> sagenb.org) causes sage to abend similarly on both boxes. How to fix
> the current installs, or reinstall more appropriately?
>

The version of Sage that's currently packaged in Debian (and hence
Ubuntu) is really really old (think: dinosaur). I suggest that you
download an Ubuntu binary from

www.sagemath.org

This will give you Sage 4.3.2, the latest release. Another option is to
download the sources and build it yourself.

Best,
Alex


--
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/

Burcin Erocal

unread,
Feb 14, 2010, 4:46:12 AM2/14/10
to sage-s...@googlegroups.com
On Sun, 14 Feb 2010 14:07:47 +1100
Alex Ghitza <agh...@gmail.com> wrote:

> On Sat, 13 Feb 2010 16:27:22 -0800 (PST), Tom Roche
> <tlr...@gmail.com> wrote:
> > summary: I installed ubuntu package=sagemath (and dependencies)
> > using aptitude on 2 previously-sage-clean ubuntu karmic boxes. Sage
> > appeared to install cleanly on both boxes, but a simple problem
> > (that works on sagenb.org) causes sage to abend similarly on both
> > boxes. How to fix the current installs, or reinstall more
> > appropriately?
> >
>
> The version of Sage that's currently packaged in Debian (and hence
> Ubuntu) is really really old (think: dinosaur).

<snip>

I also heard many people complain about this at a workshop last few
days. Unfortunately installing the debian/ubuntu package seems to be
the first choice for many potential users and it leaves a very bad
impression afterwards.

Can we get Debian/Ubuntu to move these packages to a less visible
repository. (Is it too obvious I don't use/understand Debian? :) ) Or,
at least put a disclaimer in the package description reflecting the
status.


Cheers,
Burcin

Harald Schilly

unread,
Feb 14, 2010, 6:26:49 AM2/14/10
to sage-support
On Feb 14, 10:46 am, Burcin Erocal <bur...@erocal.org> wrote:
> Can we get Debian/Ubuntu to move these packages to a less visible
> repository...

I already complained rather long ago, it's just that they have pulled
experimental packages into the multiverse repository or something like
that. I hope it will drop out with 10.4.
Btw: if you want a linux distribution with a recent sage, get
mandriva!

h

David Kirkby

unread,
Feb 14, 2010, 6:47:01 AM2/14/10
to sage-s...@googlegroups.com

As a longer term solution, would it not be worth having code in Sage
which checks if the current date is more than X months since the Sage
release date, and if so gives a warning like.

===============================================
WARNING - Sage is software under active development. Your version is
more than X months old, and you would be well advised to get an update
from http://www.sagemath.org/ Sometimes Sage gets packaged as part of
the distribution of the operating system, and these may not be updated
very often
===============================================

The easiest way I can think of it to save the release date of Sage as
seconds since the Epoch, and then use that along with the current
date. If this is done, please do *NOT* make use of the GNU-specific

date +%s

I posted a more portable way some time back, which many people tested
and found it worked fine.

Dave

Harald Schilly

unread,
Feb 14, 2010, 7:23:16 AM2/14/10
to sage-support
On Feb 14, 12:47 pm, David Kirkby <david.kir...@onetel.net> wrote:
> As a longer term solution, would it not be worth having code in Sage
> which checks if the current date is more than X months since the Sage
> release date, and if so gives a warning like...

My idea for that was to check this website:
http://www.sagemath.org/version.html

This should happen once a day or every few days, in parallel on
startup because website might not work and hence delays startup time
and should be opt-out in case you have reasons to not check this.
Going through the webserver logs, this might additionally give us an
idea how many users are out there. This would require an UID, like
Firefox and many others do, too. They create a unique client ID number
for each installation. That id would be stored in ~/.sage and appended
to this request like verson.html?uid=hashcode

H

Robert Bradshaw

unread,
Feb 15, 2010, 1:41:27 PM2/15/10
to sage-s...@googlegroups.com

-1 to the phone home idea. It might be good to warn of releases that
are really old, but this won't help with the one already in Debian.

- Robert

William Stein

unread,
Feb 15, 2010, 1:50:18 PM2/15/10
to sage-s...@googlegroups.com

Since we're voting,

+1 to the phone home idea

simply because I've received requests for this feature *frequently*
when I give talks. It's really standard in just about all major
software these days. People really want some easy automatic way to
find out when a new version has been released and is ready for them to
upgrade to.

-- William

Harald Schilly

unread,
Feb 15, 2010, 4:20:06 PM2/15/10
to sage-support
On Feb 15, 7:50 pm, William Stein <wst...@gmail.com> wrote:
>   +1 to the phone home idea

To elaborate a bit more on that, there are two methods. First, one
that just informs the user of a new release ("the current release is
<downloaded number>, but yours is <stored number>") - We only get
activity data on that certain page on the website, but since we don't
have the IP numbers, we have no idea how many different installations
are out there.

The enhanced method would be to append something unique after a "?"
sign to the URL. Personally, I have no problem with that and I know
that most of the major software packages do this. There is nothing
specific about the user sent and we do not have the IP.

We can start implementing method one and later decide if we upgrade to
method 2?

Additionally, it might be wise to append the client's current version
to the request url, so that we have an idea how outdated those sage
installations are. (i.e. http://www.sagemath.org/version.html?ver=4.3.2
)

Technically, the request should start asynchronous, in a separate
thread when sage is started - and joined with a short timeout when the
banner is displayed. Currently, my sage needs >10 secs to start and
the website has need 1.5 secs on average to respond.

H

Alex Ghitza

unread,
Feb 15, 2010, 5:47:21 PM2/15/10
to William Stein, sage-s...@googlegroups.com
On Mon, 15 Feb 2010 10:50:18 -0800, William Stein <wst...@gmail.com> wrote:
> > -1 to the phone home idea. It might be good to warn of releases that are
> > really old, but this won't help with the one already in Debian.
> >
> > - Robert
>
> Since we're voting,
>
> +1 to the phone home idea
>
> simply because I've received requests for this feature *frequently*
> when I give talks. It's really standard in just about all major
> software these days. People really want some easy automatic way to
> find out when a new version has been released and is ready for them to
> upgrade to.

Note that some of the major software that does this also allows you to
turn it off (I'm thinking of Firefox here).

Robert Bradshaw

unread,
Feb 16, 2010, 4:02:52 AM2/16/10
to sage-s...@googlegroups.com
On Feb 15, 2010, at 2:47 PM, Alex Ghitza wrote:

> On Mon, 15 Feb 2010 10:50:18 -0800, William Stein <wst...@gmail.com>
> wrote:
>>> -1 to the phone home idea. It might be good to warn of releases
>>> that are
>>> really old, but this won't help with the one already in Debian.
>>>
>>> - Robert
>>
>> Since we're voting,
>>
>> +1 to the phone home idea
>>
>> simply because I've received requests for this feature *frequently*
>> when I give talks. It's really standard in just about all major
>> software these days. People really want some easy automatic way to
>> find out when a new version has been released and is ready for them
>> to
>> upgrade to.

Hmm... Would we warn users about the new release every two weeks?
Would the notice become more permanent after a set amount of time/more
major upgrade (otherwise I think people will become desensitized).
Thinking about it more, I'm not as opposed to it as I originally
thought. It could be a good way to collect use data (versions, number
of users) though we have to be careful about that as it's a slippery
slope.

If we do decide to do this I think a formal vote would be nice to get
a sense of the "average user's" position on the balance between
convenience and privacy.

> Note that some of the major software that does this also allows you to
> turn it off (I'm thinking of Firefox here).

Yes, we should make turning off this feature easier than finding and
modifying the relevant code :).

- Robert

Reply all
Reply to author
Forward
0 new messages