Ask Your Question

Plotting in Ubuntu 12.10

asked 2012-10-31 05:54:38 -0500

anddrade gravatar image

updated 2016-07-05 15:04:09 -0500

FrédéricC gravatar image

Hi. I just installed Ubuntu 12.10 in my computer and then installed sage for Ubuntu 12.04 (I am very new to both Linux and Sage). I can open Sage in my machine using the notebook interface, but, for one thing, it doesn't plot. I copied bellow what I get when I enter 'plot(x^2)'. Any help will be appreciated. Thanks!

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 10, in <module>
    exec compile(u'open("","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGxvdCh4XjIp"),globals())+"\\n"); execfile(os.path.abspath(""))
  File "", line 1, in <module>

  File "/tmp/tmpOq5zzs/", line 3, in <module>
    exec compile(u'plot(x**_sage_const_2 )
  File "", line 1, in <module>

  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/misc/", line 176, in displayhook
    print_obj(sys.stdout, obj)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/misc/", line 144, in print_obj
    print >>out_stream, `obj`
  File "sage_object.pyx", line 154, in sage.structure.sage_object.SageObject.__repr__ (sage/structure/sage_object.c:1762)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/", line 824, in _repr_
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/misc/", line 456, in wrapper
    return func(*args, **kwds)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/", line 1735, in show**kwds)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/misc/", line 456, in wrapper
    return func(*args, **kwds)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/", line 2584, in save
    figure = self.matplotlib(**options)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/", line 2098, in matplotlib
    from matplotlib.figure import Figure
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/matplotlib/", line 133, in <module>
    from matplotlib.rcsetup import (defaultParams,
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/matplotlib/", line 19, in <module>
    from matplotlib.colors import is_color_like
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/matplotlib/", line 52, in <module>
    import numpy as np
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/", line 136, in <module>
    import add_newdocs
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/lib/", line 13, in <module>
    from polynomial import *
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/lib/", line 11, in <module>
    import numpy.core.numeric as ...
edit retag flag offensive close merge delete


This could be due to using the binary for the different Ubuntu version; these binaries tend to be very finicky... Luckily, Sage isn't very hard to build from source!

kcrisman gravatar imagekcrisman ( 2012-10-31 07:26:28 -0500 )edit

2 answers

Sort by » oldest newest most voted

answered 2012-11-02 19:55:20 -0500

anddrade gravatar image

After seeing these comments a friend of mine suggested:

sudo apt-get install python-numpy

It seems to have worked (but I don't know why), I mean at least now it plots. There are no other problems that I am aware of now.

Thanks everybody!

edit flag offensive delete link more


This worked for me

Jean-Sébastien gravatar imageJean-Sébastien ( 2014-02-06 10:50:26 -0500 )edit

answered 2012-10-31 16:24:14 -0500

Jason Grout gravatar image

Like kcrisman says in the comment, I would definitely recommend compiling Sage rather than trying to run a version of Sage built for a different version of Ubuntu.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-10-31 05:54:38 -0500

Seen: 778 times

Last updated: Nov 02 '12