(I figured I didn't indicate my OS and the version of Sage that I'm using,
so I'm making a new question to add those details. You can ignore the
previous post)
Hi, I'm having a problem running the following code:
var('x')
sinc(x) = sin(x) / x
plot(sinc, (x, -10, 10))
as it produces the following error (quite long)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-04a086d308e2> in <module>()
----> 1 plot(sinc, (x, -Integer(10), Integer(10)))
/home/myorro/Sage/local/lib/python2.7/site-packages/IPython/core/displayhook
.pyc in __call__(self, result)
250 self.start_displayhook()
251 self.write_output_prompt()
--> 252 format_dict, md_dict = self.compute_format_data(result)
253 self.write_format_data(format_dict, md_dict)
254 self.update_user_ns(result)
/home/myorro/Sage/local/lib/python2.7/site-packages/IPython/core/displayhook
.pyc in compute_format_data(self, result)
152
153 """
--> 154 return self.shell.display_formatter.format(result)
155
156 def write_format_data(self, format_dict, md_dict=None):
/home/myorro/Sage/local/lib/python2.7/site-packages/IPython/core/formatters.pyc
in format(self, obj, include, exclude)
198 md = None
199 try:
--> 200 data = formatter(obj)
201 except:
202 # FIXME: log the exception
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
in __call__(self, obj)
518 sage: fmt.set_display('simple')
519 """
--> 520 if self.try_format_graphics(obj):
521 return ''
522 s = self.try_format_obj(obj)
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
in try_format_graphics(self, obj)
415 from sage.structure.sage_object import SageObject
416 if isinstance(obj, SageObject) and hasattr(obj, '_graphics_'
):
--> 417 return obj._graphics_()
418 return False
419
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in _graphics_(self)
822 Graphics object consisting of 0 graphics primitives]
823 """
--> 824 self.show()
825 return True
826
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
in wrapper(*args, **kwds)
469 kwds[self.name + "options"] = suboptions
470
--> 471 return func(*args, **kwds)
472
473 #Add the options specified by @options to the signature of
the wrapped
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in show(self, filename, linkmode, **kwds)
1816 filename = graphics_filename()
1817
-> 1818 self.save(filename, **kwds)
1819
1820 if sage.plot.plot.EMBEDDED_MODE:
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
in wrapper(*args, **kwds)
469 kwds[self.name + "options"] = suboptions
470
--> 471 return func(*args, **kwds)
472
473 #Add the options specified by @options to the signature of
the wrapped
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in save(self, filename, **kwds)
2893 SageObject.save(self, filename)
2894 else:
-> 2895 from matplotlib import rcParams
2896 rc_backup = (rcParams['ps.useafm'],
rcParams['pdf.use14corefonts'],
2897 rcParams['text.usetex']) # save the
rcParams
/home/myorro/Sage/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/__init__.py
in <module>()
154 # cbook must import matplotlib only within function
155 # definitions, so it is safe to import from it here.
--> 156 from matplotlib.cbook import is_string_like
157 from matplotlib.compat import subprocess
158
/home/myorro/Sage/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/cbook.py
in <module>()
26 from weakref import ref, WeakKeyDictionary
27
---> 28 import numpy as np
29 import numpy.ma as ma
30
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/__init__.pyc in
<module>()
151 return loader(*packages, **options)
152
--> 153 from . import add_newdocs
154 __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
155
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/add_newdocs.py in
<module>()
11 from __future__ import division, absolute_import, print_function
12
---> 13 from numpy.lib import add_newdoc
14
15
###############################################################################
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/lib/__init__.py
in <module>()
16
17 from . import scimath as emath
---> 18 from .polynomial import *
19 #import convertcode
20 from .utils import *
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/lib/polynomial.py
in <module>()
17 from numpy.lib.function_base import trim_zeros, sort_complex
18 from numpy.lib.type_check import iscomplex, real, imag
---> 19 from numpy.linalg import eigvals, lstsq, inv
20
21 class RankWarning(UserWarning):
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/linalg/__init__.py
in <module>()
48 from .info import __doc__
49
---> 50 from .linalg import *
51
52 from numpy.testing import Tester
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/linalg/linalg.py
in <module>()
27 )
28 from numpy.lib import triu, asfarray
---> 29 from numpy.linalg import lapack_lite, _umath_linalg
30 from numpy.matrixlib.defmatrix import matrix_power
31 from numpy.compat import asbytes
ImportError: libgfortran.so.3: cannot open shared object file: No such file
or directory
and when I do the plot code again, the following error appears:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-04a086d308e2> in <module>()
----> 1 plot(sinc, (x, -Integer(10), Integer(10)))
/home/myorro/Sage/local/lib/python2.7/site-packages/IPython/core/displayhook
.pyc in __call__(self, result)
250 self.start_displayhook()
251 self.write_output_prompt()
--> 252 format_dict, md_dict = self.compute_format_data(result)
253 self.write_format_data(format_dict, md_dict)
254 self.update_user_ns(result)
/home/myorro/Sage/local/lib/python2.7/site-packages/IPython/core/displayhook
.pyc in compute_format_data(self, result)
152
153 """
--> 154 return self.shell.display_formatter.format(result)
155
156 def write_format_data(self, format_dict, md_dict=None):
/home/myorro/Sage/local/lib/python2.7/site-packages/IPython/core/formatters.pyc
in format(self, obj, include, exclude)
198 md = None
199 try:
--> 200 data = formatter(obj)
201 except:
202 # FIXME: log the exception
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
in __call__(self, obj)
518 sage: fmt.set_display('simple')
519 """
--> 520 if self.try_format_graphics(obj):
521 return ''
522 s = self.try_format_obj(obj)
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/displayhook.pyc
in try_format_graphics(self, obj)
415 from sage.structure.sage_object import SageObject
416 if isinstance(obj, SageObject) and hasattr(obj, '_graphics_'
):
--> 417 return obj._graphics_()
418 return False
419
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in _graphics_(self)
822 Graphics object consisting of 0 graphics primitives]
823 """
--> 824 self.show()
825 return True
826
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
in wrapper(*args, **kwds)
469 kwds[self.name + "options"] = suboptions
470
--> 471 return func(*args, **kwds)
472
473 #Add the options specified by @options to the signature of
the wrapped
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in show(self, filename, linkmode, **kwds)
1816 filename = graphics_filename()
1817
-> 1818 self.save(filename, **kwds)
1819
1820 if sage.plot.plot.EMBEDDED_MODE:
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
in wrapper(*args, **kwds)
469 kwds[self.name + "options"] = suboptions
470
--> 471 return func(*args, **kwds)
472
473 #Add the options specified by @options to the signature of
the wrapped
/home/myorro/Sage/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
in save(self, filename, **kwds)
2893 SageObject.save(self, filename)
2894 else:
-> 2895 from matplotlib import rcParams
2896 rc_backup = (rcParams['ps.useafm'],
rcParams['pdf.use14corefonts'],
2897 rcParams['text.usetex']) # save the
rcParams
/home/myorro/Sage/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/__init__.py
in <module>()
154 # cbook must import matplotlib only within function
155 # definitions, so it is safe to import from it here.
--> 156 from matplotlib.cbook import is_string_like
157 from matplotlib.compat import subprocess
158
/home/myorro/Sage/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/cbook.py
in <module>()
26 from weakref import ref, WeakKeyDictionary
27
---> 28 import numpy as np
29 import numpy.ma as ma
30
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/__init__.py in
<module>()
151 return loader(*packages, **options)
152
--> 153 from . import add_newdocs
154 __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
155
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/add_newdocs.py in
<module>()
11 from __future__ import division, absolute_import, print_function
12
---> 13 from numpy.lib import add_newdoc
14
15
###############################################################################
/home/myorro/Sage/local/lib/python2.7/site-packages/numpy/lib/__init__.py
in <module>()
15 from .ufunclike import *
16
---> 17 from . import scimath as emath
18 from .polynomial import *
19 #import convertcode
ImportError: cannot import name scimath
I'm not really adept with coding in Python, so I don't know how to solve
this problem. Can anyone please
(a) tell me what the problem(s) is(are)?
(b) tell me how to solve it?
(c) tell me how to avoid such problems in the future?
BTW, I'm using an Ubuntu 14.04 LTS 64-bit and a 'Version 6.3, Release Date:
2014-08-10' of Sage.
Thanks!
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.