Ask Your Question
0

Plotting in Ubuntu 12.10

asked 2012-10-31 11:54:38 +0100

anddrade gravatar image

updated 2016-07-05 22:04:09 +0100

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 "_sage_input_10.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGxvdCh4XjIp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmpOq5zzs/___code___.py", 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/displayhook.py", 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/displayhook.py", 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/graphics.py", line 824, in _repr_
    self.show()
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 456, in wrapper
    return func(*args, **kwds)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/graphics.py", line 1735, in show
    self.save(**kwds)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/misc/decorators.py", line 456, in wrapper
    return func(*args, **kwds)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/graphics.py", line 2584, in save
    figure = self.matplotlib(**options)
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/sage/plot/graphics.py", line 2098, in matplotlib
    from matplotlib.figure import Figure
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 133, in <module>
    from matplotlib.rcsetup import (defaultParams,
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/matplotlib/rcsetup.py", 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/colors.py", line 52, in <module>
    import numpy as np
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/__init__.py", line 136, in <module>
    import add_newdocs
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/add_newdocs.py", 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/__init__.py", line 13, in <module>
    from polynomial import *
  File "/home/rodrigo/Downloads/opt/sage-5.3/local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 11, in <module>
    import numpy.core.numeric as ...
(more)
edit retag flag offensive close merge delete

Comments

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 13:26:28 +0100 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2012-11-03 01:55:20 +0100

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

Comments

This worked for me

Jean-Sébastien gravatar imageJean-Sébastien ( 2014-02-06 17:50:26 +0100 )edit
0

answered 2012-10-31 22:24:14 +0100

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

Stats

Asked: 2012-10-31 11:54:38 +0100

Seen: 1,360 times

Last updated: Nov 03 '12