ERROR: An unexpected error occurred while tokenizing input

i like this post (click again to cancel)
0
i dont like this post (click again to cancel)

Just installed Sage 5.0.1 on Ubuntu 12.04 32-bit. Simple test operations work fine:

sage:1+1 
2
sage: expand((1+x)^2)
x^2 + 2*x + 1
sage:maxima(console)
;;; Loading #P"/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/ecl/sockets.fas"
;;; Loading #P"/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/ecl/defsystem.fas"
;;; Loading #P"/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/ecl/cmp.fas"
Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 11.1.1
[...]

But errors occur with any plot command that I have tried. See below. What do they mean?

PD. By the way, I have just tried plotting from this Maxima console called by Sage, i.e. something like:

(%i2) plot2d(sin(x),[x,0,1]);

and it works fine, producing the plot through Gnuplot. What is a bit paradoxical...

================================================================

----------------------------------------------------------------------
| Sage Version 5.0.1, Release Date: 2012-06-10                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: plot(x,0,1)
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', (2097, 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', (273, 0))

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

/home/jakubi/<ipython console=""> in <module>()

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/IPython/Prompts.pyc in __call__(self, arg)
    550 
    551             # and now call a possibly user-defined print mechanism
--> 552             manipulated_val = self.display(arg)
    553             
    554             # user display hooks can change the variable to be stored in

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/IPython/Prompts.pyc in _display(self, arg)
    576             return IPython.generics.result_display(arg)
    577         except TryNext:            
--> 578             return self.shell.hooks.result_display(arg)
    579 
    580     # Assign the default display method:

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/IPython/hooks.pyc in __call__(self, *args, **kw)
    139             #print "prio",prio,"cmd",cmd #dbg
    140             try:
--> 141                 ret = cmd(*args, **kw)
    142                 return ret
    143             except ipapi.TryNext, exc:

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc in result_display(ip_self, obj)
    150     # IPython's default result_display() uses the IPython.genutils.Term.cout stream.
    151     # See also local/lib/python2.6/site-packages/IPython/hooks.py.
--> 152     print_obj(IPython.genutils.Term.cout, obj)
    153 
    154 def displayhook(obj):

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc in print_obj(out_stream, obj)
    142             if _check_tall_list_and_print(out_stream, obj):
    143                 return
--> 144     print >>out_stream, `obj`
    145 
    146 def result_display(ip_self, obj):

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/structure/sage_object.so in sage.structure.sage_object.SageObject.__repr__ (sage/structure/sage_object.c:1496)()

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in _repr_(self)
    801         """
    802         if SHOW_DEFAULT:
--> 803             self.show()
    804             return ''
    805         else:

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
    454             kwds[self.name + "options"] = suboptions
    455 
--> 456             return func(*args, **kwds)
    457 
    458         #Add the options specified by @options to the signature of the wrapped

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in show(self, **kwds)
   1479         else:
   1480             kwds.setdefault('filename', sage.misc.misc.tmp_filename() + '.png')
-> 1481             self.save(**kwds)
   1482             os.system('%s %s 2>/dev/null 1>/dev/null &'
   1483                       % (sage.misc.viewer.browser(), kwds['filename']))

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
    454             kwds[self.name + "options"] = suboptions
    455 
--> 456             return func(*args, **kwds)
    457 
    458         #Add the options specified by @options to the signature of the wrapped

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in save(self, filename, **kwds)
   2197             SageObject.save(self, filename)
   2198         else:
-> 2199             figure = self.matplotlib(**options)
   2200             # You can output in PNG, PS, EPS, PDF, or SVG format, depending on the file extension.
   2201             # matplotlib looks at the file extension to see what the renderer should be.

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in matplotlib(self, filename, xmin, xmax, ymin, ymax, figsize, figure, sub, axes, axes_labels, fontsize, frame, verify, aspect_ratio, gridlines, gridlinesstyle, vgridlinesstyle, hgridlinesstyle, show_legend, legend_options, axes_pad, ticks_integer, tick_formatter, ticks)
   1677             axes = self.__show_axes
   1678 
-> 1679         from matplotlib.figure import Figure
   1680         from matplotlib import rcParams
   1681         self.fontsize(fontsize)

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/matplotlib/__init__.py in <module>()
    131 import sys, os, tempfile
    132 
--> 133 from matplotlib.rcsetup import (defaultParams,
    134                                 validate_backend,
    135                                 validate_toolbar,

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/matplotlib/rcsetup.py in <module>()
     17 import warnings
     18 from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
---> 19 from matplotlib.colors import is_color_like
     20 
     21 #interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'fltkagg', 'qtagg', 'qt4agg',

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/matplotlib/colors.py in <module>()
     50 """
     51 import re
---> 52 import numpy as np
     53 from numpy import ma
     54 import matplotlib.cbook as cbook

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/__init__.py in <module>()
    134         return loader(*packages, **options)
    135 
--> 136     import add_newdocs
    137     __all__ = ['add_newdocs']
    138 

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>()
      7 #       core/fromnumeric.py, core/defmatrix.py up-to-date.
      8 
----> 9 from numpy.lib import add_newdoc
     10 
     11 ###############################################################################

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
     11 
     12 import scimath as emath
---> 13 from polynomial import *
     14 #import convertcode
     15 from utils import *

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/lib/polynomial.py in <module>()
     15 from numpy.lib.function_base import trim_zeros, sort_complex
     16 from numpy.lib.type_check import iscomplex, real, imag
---> 17 from numpy.linalg import eigvals, lstsq
     18 
     19 class RankWarning(UserWarning):

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/linalg/__init__.py in <module>()
     46 from info import __doc__
     47 
---> 48 from linalg import *
     49 
     50 from numpy.testing import Tester

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/linalg/linalg.py in <module>()
     21         isfinite, size, finfo, absolute, log, exp
     22 from numpy.lib import triu
---> 23 from numpy.linalg import lapack_lite
     24 from numpy.matrixlib.defmatrix import matrix_power
     25 from numpy.compat import asbytes

ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
sage: plot(x,0,1)                                                                                                                        
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', (2097, 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', (273, 0))

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

/home/jakubi/<ipython console=""> in <module>()

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/IPython/Prompts.pyc in __call__(self, arg)
    550 
    551             # and now call a possibly user-defined print mechanism
--> 552             manipulated_val = self.display(arg)
    553             
    554             # user display hooks can change the variable to be stored in

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/IPython/Prompts.pyc in _display(self, arg)
    576             return IPython.generics.result_display(arg)
    577         except TryNext:            
--> 578             return self.shell.hooks.result_display(arg)
    579 
    580     # Assign the default display method:

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/IPython/hooks.pyc in __call__(self, *args, **kw)
    139             #print "prio",prio,"cmd",cmd #dbg
    140             try:
--> 141                 ret = cmd(*args, **kw)
    142                 return ret
    143             except ipapi.TryNext, exc:

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc in result_display(ip_self, obj)
    150     # IPython's default result_display() uses the IPython.genutils.Term.cout stream.
    151     # See also local/lib/python2.6/site-packages/IPython/hooks.py.
--> 152     print_obj(IPython.genutils.Term.cout, obj)
    153 
    154 def displayhook(obj):

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc in print_obj(out_stream, obj)
    142             if _check_tall_list_and_print(out_stream, obj):
    143                 return
--> 144     print >>out_stream, `obj`
    145 
    146 def result_display(ip_self, obj):

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/structure/sage_object.so in sage.structure.sage_object.SageObject.__repr__ (sage/structure/sage_object.c:1496)()

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in _repr_(self)
    801         """
    802         if SHOW_DEFAULT:
--> 803             self.show()
    804             return ''
    805         else:

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
    454             kwds[self.name + "options"] = suboptions
    455 
--> 456             return func(*args, **kwds)
    457 
    458         #Add the options specified by @options to the signature of the wrapped

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in show(self, **kwds)
   1479         else:
   1480             kwds.setdefault('filename', sage.misc.misc.tmp_filename() + '.png')
-> 1481             self.save(**kwds)
   1482             os.system('%s %s 2>/dev/null 1>/dev/null &'
   1483                       % (sage.misc.viewer.browser(), kwds['filename']))

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
    454             kwds[self.name + "options"] = suboptions
    455 
--> 456             return func(*args, **kwds)
    457 
    458         #Add the options specified by @options to the signature of the wrapped

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in save(self, filename, **kwds)
   2197             SageObject.save(self, filename)
   2198         else:
-> 2199             figure = self.matplotlib(**options)
   2200             # You can output in PNG, PS, EPS, PDF, or SVG format, depending on the file extension.
   2201             # matplotlib looks at the file extension to see what the renderer should be.

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/sage/plot/graphics.pyc in matplotlib(self, filename, xmin, xmax, ymin, ymax, figsize, figure, sub, axes, axes_labels, fontsize, frame, verify, aspect_ratio, gridlines, gridlinesstyle, vgridlinesstyle, hgridlinesstyle, show_legend, legend_options, axes_pad, ticks_integer, tick_formatter, ticks)
   1677             axes = self.__show_axes
   1678 
-> 1679         from matplotlib.figure import Figure
   1680         from matplotlib import rcParams
   1681         self.fontsize(fontsize)

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/matplotlib/__init__.py in <module>()
    131 import sys, os, tempfile
    132 
--> 133 from matplotlib.rcsetup import (defaultParams,
    134                                 validate_backend,
    135                                 validate_toolbar,

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/matplotlib/rcsetup.py in <module>()
     17 import warnings
     18 from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
---> 19 from matplotlib.colors import is_color_like
     20 
     21 #interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'fltkagg', 'qtagg', 'qt4agg',

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/matplotlib/colors.py in <module>()
     50 """
     51 import re
---> 52 import numpy as np
     53 from numpy import ma
     54 import matplotlib.cbook as cbook

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/__init__.py in <module>()
    134         return loader(*packages, **options)
    135 
--> 136     import add_newdocs
    137     __all__ = ['add_newdocs']
    138 

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>()
      7 #       core/fromnumeric.py, core/defmatrix.py up-to-date.
      8 
----> 9 from numpy.lib import add_newdoc
     10 
     11 ###############################################################################

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
     11 
     12 import scimath as emath
---> 13 from polynomial import *
     14 #import convertcode
     15 from utils import *

/opt/sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux/local/lib/python2.7/site-packages/numpy/lib/polynomial.py in <module>()
      9 import re
     10 import warnings
---> 11 import numpy.core.numeric as NX
     12 
     13 from numpy.core import isscalar, abs, finfo, atleast_1d, hstack

AttributeError: 'module' object has no attribute 'core'

asked Jun 25 '12

jakubi gravatar image jakubi
1 2

updated Jun 26 '12

Is this a binary install or a source install?

benjaminfjones (Jun 26 '12)

It is a binary install (sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux.tar.lzma, from http://www.sagemath.org/download.html)

jakubi (Jun 26 '12)

As I have not received any useful information so far, I have tried with a couple of previous versions of Sage that I had saved as a backup from an older machine. These are 3.2.3 for Debian 4,0 and 4.7.1 for Ubuntu 10.04. It happens that (simple) plot tests did worked for them, both for the console and the notebook. Then, tried again with ver. 5.0.1 and this time the plots worked. Clearly a rational explanation is missing. A by product is that the .sage directory and possibly other configuration items became somewhat upset, and some oddities are observable. Do I open a new thread for these and related issues?

jakubi (Jun 29 '12)

If you have an old .sage directory you should try moving it out of the way (to .sage-old or something). When sage-5.0.1 starts up it will create a new clean one. Try that and see if your plots work.

benjaminfjones (Jun 29 '12)

No, it is the other way. The .sage directory was originally "new" and 'clean", i.e. created by Sage 5.0.1. And the reported errors occurred with it. Later, the previous versions, when executed, added their stuff to this directory. And whatever they did, the result is that now plots work in Sage 5.0.1 (as well as in the previous versions).

jakubi (Jun 29 '12)

Be the first one to answer this question!

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Tags:

Stats:

Asked: Jun 25 '12

Seen: 209 times

Last updated: Jun 26 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.