Problems using sagetex package

10 views
Skip to first unread message

Alex Lara

unread,
Mar 5, 2009, 1:35:17 AM3/5/09
to sage-support
Hi there,

I was trying to use the sagetex package unsuccessfully. I tried with
example.tex.
After I start running sage example.tex I got the following messages:
Processing Sage code for example.tex...
Inline formula 0
Inline formula 1
Inline formula 2
Inline formula 3
Code block begin...
**** Error in Sage code on line 33 of example.tex! Traceback follows.
Traceback (most recent call last):
.
.
.
raise RuntimeError, "Unable to start %s"%self.__name
RuntimeError: Unable to start maxima

**** Running Sage on example.sage failed! Fix example.tex and try
again.
.
.
-

Somebody know how to fix this?

Thanks,

---Alex

Harald Schilly

unread,
Mar 5, 2009, 6:08:58 AM3/5/09
to sage-support


On Mar 5, 7:35 am, Alex Lara <lrodr...@gmail.com> wrote:
>
> RuntimeError: Unable to start maxima
>

Hi, I've never seen this error before. If you just start sage in the
commandline from the directory where the tex files are, can you do
symbolic operations? (i.e. works maxima ?)

H

Dan Drake

unread,
Mar 5, 2009, 6:13:36 AM3/5/09
to sage-s...@googlegroups.com
On Wed, 04 Mar 2009 at 10:08PM -0800, Craig Citro wrote:
> > Do you know the sagetex package? I followed the directions to use the
> > sagetex package, without successful. I tried with the example and I
> > got the following messages:
> >
>
> Honestly, I've never used sagetex myself -- I hear it's really cool.
> Dan Drake is the man to ask -- I'm pretty sure he reads sage-support,

He not only reads sage-support, but occasionally refers to himself in
the third person...

As for your question:

On Wed, 04 Mar 2009 at 10:35PM -0800, Alex Lara wrote:
> I was trying to use the sagetex package unsuccessfully. I tried with
> example.tex.
> After I start running sage example.tex I got the following messages:
> Processing Sage code for example.tex...
> Inline formula 0
> Inline formula 1
> Inline formula 2
> Inline formula 3
> Code block begin...
> **** Error in Sage code on line 33 of example.tex! Traceback follows.
> Traceback (most recent call last):
> .
> .
> .
> raise RuntimeError, "Unable to start %s"%self.__name
> RuntimeError: Unable to start maxima

This is a problem with Sage, not SageTeX. For some reason, Sage can't
start Maxima. What happens if you start Sage normally and try to do some
calculus?

Dan

--
--- Dan Drake <dr...@kaist.edu>
----- KAIST Department of Mathematical Sciences
------- http://mathsci.kaist.ac.kr/~drake

signature.asc

Alex Lara

unread,
Mar 5, 2009, 8:44:31 AM3/5/09
to sage-support
Hi Dan,
You are totally right. The problem is that Sage can't start maxima.
Here is part of the output when I typed

sage: var('x k w')
(x, k, w)
sage: f = x^3 * e^(k*x) * sin(w*x); f
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
...
RuntimeError: Unable to start maxima

So, I guess I need to fix this first (how I don't know). right?

---Alex
>  signature.asc
> < 1KViewDownload

Dan Drake

unread,
Mar 5, 2009, 6:03:12 PM3/5/09
to sage-s...@googlegroups.com
On Thu, 05 Mar 2009 at 05:44AM -0800, Alex Lara wrote:
> Hi Dan,
> You are totally right. The problem is that Sage can't start maxima.
> Here is part of the output when I typed
>
> sage: var('x k w')
> (x, k, w)
> sage: f = x^3 * e^(k*x) * sin(w*x); f
> ---------------------------------------------------------------------------
> RuntimeError Traceback (most recent call
> last)
> ...
> RuntimeError: Unable to start maxima
>
> So, I guess I need to fix this first (how I don't know). right?

I'm not quite sure what to do, but an obvious first step is to try
reinstalling the Maxima spkg. Try

sage -f http://sagemath.org/packages/standard/maxima-5.16.3.spkg

and see if that fixes things.

signature.asc

Alex Lara

unread,
Mar 5, 2009, 10:42:16 PM3/5/09
to sage-support
Hi Drake,

I didn't work. I have to versions of sage (3.1.1 and 3.2.3) running on
my laptop. Really I don't have any clue of what's happening.

---Alex.

On Mar 5, 4:03 pm, Dan Drake <dr...@kaist.edu> wrote:
> On Thu, 05 Mar 2009 at 05:44AM -0800, Alex Lara wrote:
> > Hi Dan,
> > You are totally right. The problem is that Sage can't start maxima.
> > Here is part of the output when I typed
>
> > sage: var('x k w')
> > (x, k, w)
> > sage: f = x^3 * e^(k*x) * sin(w*x); f
> > ---------------------------------------------------------------------------
> > RuntimeError                              Traceback (most recent call
> > last)
> > ...
> > RuntimeError: Unable to start maxima
>
> > So, I guess I need to fix this first (how I don't know). right?
>
> I'm not quite sure what to do, but an obvious first step is to try
> reinstalling the Maxima spkg. Try
>
>   sage -fhttp://sagemath.org/packages/standard/maxima-5.16.3.spkg
>
> and see if that fixes things.
>
> Dan
>
> --
> ---  Dan Drake <dr...@kaist.edu>
> -----  KAIST Department of Mathematical Sciences
> -------  http://mathsci.kaist.ac.kr/~drake
>
>  signature.asc
> < 1KViewDownload

Marshall Hampton

unread,
Mar 5, 2009, 11:38:21 PM3/5/09
to sage-support
What operating system and type of computer are you using? Did you
install from source or with a binary?

-M. Hampton

Alex Lara

unread,
Mar 6, 2009, 12:37:01 AM3/6/09
to sage-support
Hi Marshall

I'm using Ubuntu 8.04, in a laptop Dell inspiron 1420. I installed
from source. I have 3.1.1. and 3.2.3. I was checking, maxima does not
work at all. I can't do a simple example like:

sage: x = var('x')
sage: solve(x^2 + 3*x + 2, x)

---Alex

Mike Hansen

unread,
Mar 6, 2009, 1:13:27 AM3/6/09
to sage-s...@googlegroups.com
Hi Alex,

On Thu, Mar 5, 2009 at 9:37 PM, Alex Lara <lrod...@gmail.com> wrote:
>
> Hi Marshall
>
> I'm using Ubuntu 8.04, in a laptop Dell inspiron 1420. I installed
> from source. I have 3.1.1. and 3.2.3. I was checking, maxima does not
> work at all. I can't do a simple example like:
>
> sage: x = var('x')
> sage: solve(x^2 + 3*x + 2, x)

What do you get when you run "sage -maxima"?

--Mike

Alex Lara

unread,
Mar 6, 2009, 1:45:26 AM3/6/09
to sage-support
On Mar 5, 11:13 pm, Mike Hansen <mhan...@gmail.com> wrote:
> Hi Alex,
>
> On Thu, Mar 5, 2009 at 9:37 PM, Alex Lara <lrodr...@gmail.com> wrote:
>
> > Hi Marshall
>
> > I'm using Ubuntu 8.04, in a laptop Dell inspiron 1420. I installed
> > from source. I have 3.1.1. and 3.2.3. I was checking, maxima does not
> > work at all. I can't do a simple example like:
>
> > sage: x = var('x')
> > sage: solve(x^2 + 3*x + 2, x)
>
> What do you get when you run "sage -maxima"?
>
> --Mike

I got this:

*** - invalid byte #xC3 in CHARSET:ASCII conversion
Break 1 [4]>

---alex

Dan Drake

unread,
Mar 6, 2009, 4:33:36 AM3/6/09
to sage-s...@googlegroups.com
On Thu, 05 Mar 2009 at 10:45PM -0800, Alex Lara wrote:
> > What do you get when you run "sage -maxima"?
> >
> > --Mike
>
> I got this:
>
> *** - invalid byte #xC3 in CHARSET:ASCII conversion
> Break 1 [4]>

I am totally guessing here, but is there a non-ascii character somewhere
in the path to your Sage install, or in your shell's $PATH?

signature.asc

William Stein

unread,
Mar 6, 2009, 10:21:32 AM3/6/09
to sage-s...@googlegroups.com
On Fri, Mar 6, 2009 at 1:33 AM, Dan Drake <dr...@kaist.edu> wrote:
> On Thu, 05 Mar 2009 at 10:45PM -0800, Alex Lara wrote:
>> > What do you get when you run "sage -maxima"?
>> >
>> > --Mike
>>
>> I got this:
>>
>> *** - invalid byte #xC3 in CHARSET:ASCII conversion
>> Break 1 [4]>
>
> I am totally guessing here, but is there a non-ascii character somewhere
> in the path to your Sage install, or in your shell's $PATH?

That's a good guess. There is a known major bug in Maxima + clisp where
it totally fails to work if there are certain non-ascii characters in the
filenames in the current directory or PATH. I can't wait until clisp isn't
in Sage.

>
> Dan
>
> --
> ---  Dan Drake <dr...@kaist.edu>
> -----  KAIST Department of Mathematical Sciences
> -------  http://mathsci.kaist.ac.kr/~drake
>

> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkmw7fAACgkQr4V8SljC5Lp5YwCfe+WRYLfaH6suwEKaL4TlorOb
> 23sAnjZMePg3aYtcBumhxsngrICzeOXW
> =WCyC
> -----END PGP SIGNATURE-----
>
>

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

Alex Lara

unread,
Mar 6, 2009, 10:28:37 AM3/6/09
to sage-support
Hi there,

I suppose it has to be with permissions. Sage is installed at my home
directory. If a run sage as a root (su and then ./sage) maxima
works!!! But if only run sage with sudo ./sage it does'nt.

Do you have an idea why is that?

---Alex

William Stein

unread,
Mar 6, 2009, 10:32:01 AM3/6/09
to sage-s...@googlegroups.com
On Fri, Mar 6, 2009 at 7:28 AM, Alex Lara <lrod...@gmail.com> wrote:
>
> Hi there,
>
> I suppose it has to be with permissions. Sage is installed at my home
> directory. If a run sage as a root (su and then ./sage) maxima
> works!!! But if only run sage with sudo ./sage it does'nt.
>
> Do you have an idea why is that?

That could also be exactly what Dan and I said -- a funny filename character
issue, which you don't see was root since root has different files in root's
PATH.

William

Robert Dodier

unread,
Mar 6, 2009, 10:54:33 AM3/6/09
to sage-support
William Stein wrote:

> > On Thu, 05 Mar 2009 at 10:45PM -0800, Alex Lara wrote:

> >> *** - invalid byte #xC3 in CHARSET:ASCII conversion

Try this: change the environment variable LC_CTYPE
e.g. LC_CTYPE=ES_es or LC_CTYPE=ES_es.UTF-8 or something
like that. Or maybe somehow indicated ISO 8859-1 or Latin-1 or
something. Then Clisp might know how to decode the offending bytes.

Another tactic: put the following in your $HOME/.clisprc file.

(format t "HELLO FROM CLISPRC~%")
(ignore-errors
(progn (setf custom:*default-file-encoding*
(ext:make-encoding :input-error-action #\?))
(setf custom:*terminal-encoding*
custom:*default-file-encoding*)))

That replaces undecodable bytes by '?' characters.
(The "hello" message is just to verify the code is loaded ....)

> That's a good guess. There is a known major bug in Maxima + clisp where
> it totally fails to work if there are certain non-ascii characters in the
> filenames in the current directory or PATH. I can't wait until clisp isn't
> in Sage.

The bad news is that it's not exactly a Clisp idiosyncrasy.
Clisp is trying to "do the right thing" when faced with undecodable
bytes.
Unfortunately the Common Lisp spec, while it recognizes the
existence of character encoding issues, doesn't specify what to do
when a byte can't be decoded to a character. Other Lisp
implementations
probably have their own ways to handle it.

FWIW

Robert Dodier

William Stein

unread,
Mar 6, 2009, 10:56:03 AM3/6/09
to sage-s...@googlegroups.com

Many thanks for the workarounds above! We may be able to at least
automate them for Sage, which would be a step forward.

That said -- I'm really looking forward to Sage switching to Maxima + ECL.

William

Robert Dodier

unread,
Mar 6, 2009, 11:29:19 AM3/6/09
to sage-support
On Mar 6, 8:56 am, William Stein <wst...@gmail.com> wrote:

> That said -- I'm really looking forward to Sage switching to Maxima + ECL.

I;'m pretty sure ECL will exhibit some variation on Clisp's behavior,
for better or worse.

Robert Dodier

Alex Lara

unread,
Mar 6, 2009, 3:58:15 PM3/6/09
to sage-support
Sagetex is working!!! (and also Maxima).

I did the following:

I found that LANG=ex_MX.UTF-8 but .bashrc had
export LC_ALL=C. So I commented and run
sudo dpkg-reconfigure locales

After that Maxima start to works.

Thanks for the support.

----Alex
Reply all
Reply to author
Forward
0 new messages