ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 07 Feb 2017 11:15:51 -0600How can I use markdown in a Sage worksheet?http://ask.sagemath.org/question/36478/how-can-i-use-markdown-in-a-sage-worksheet/In Sage within a Jupyter notebook, I can use the pulldown menu to select the markdown option and use markdown commands. I can also use
%load_ext sage
to use Sage commands.
If I'm in a Sage worksheet, is there a package to load so that I can use markdown commands? Or alternatively, is there a way I can get two different colors of comments with a hashtag (#)?ElkTue, 07 Feb 2017 11:15:51 -0600http://ask.sagemath.org/question/36478/IP-Notebooks and extensions, Sage versus Sage Cloudhttp://ask.sagemath.org/question/23226/ip-notebooks-and-extensions-sage-versus-sage-cloud/ In Sage Math Cloud I can open an IP:Notebook, execute
%load_ext sage
and Sage runs whithin the IP:Notebook.
Trying to do the same with my local IPython fails. I get an ImportError:
../IPython/core/extensions.py in load_extension(self, module_str)
96 if module_str not in sys.modules:
97 with prepended_to_syspath(self.ipython_extension_dir):
---> 98 __import__(module_str)
99 mod = sys.modules[module_str]
100 if self._call_load_ipython_extension(mod):
ImportError: No module named 'sage'
Where can I get this module 'sage'? Or is it private to SMC?
-- **EDIT** -- [26-11-2014]
According to slelievre below:
"In Sage 6.4.beta6 or later, $ sage --notebook=ipython should also work."
In fact I get:
sage --notebook=ipython
Sage Version 6.4, Release Date: 2014-11-14 │
File "/sage-6.4/src/bin/sage-notebook", line 180, in <module>
launcher(unknown)
File "/sage-6.4/src/bin/sage-notebook", line 69, in __init__
from sage.repl.notebook_ipython import SageNotebookApp
File "/sage-6.4/local/lib/python2.7/site-packages/sage/repl/notebook_ipython.py", line 14, in <module>
from IPython.html.notebookapp import NotebookApp
File "/sage-6.4/local/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 62, in <module>
from tornado import httpserver
File "/sage-6.4/local/lib/python2.7/site-packages/tornado-3.1.1-py2.7.egg/tornado/httpserver.py", line 30, in <module>
import ssl
File "/sage-6.4/local/lib/python/ssl.py", line 60, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
Peter LuschnySat, 05 Jul 2014 10:12:23 -0500http://ask.sagemath.org/question/23226/Sage ranges in IP-Notebooks on CSMhttp://ask.sagemath.org/question/11073/sage-ranges-in-ip-notebooks-on-csm/On cloud.sagemath
%load_ext sage
def f(n):
for k in (1..n):
print n
f(5)
gives
AttributeError
----> 1 f(Integer(5))
in f(n)
2
3 def f(n):
----> 4 for k in (1..n):
5 print n
AttributeError: 'float' object has no attribute 'n'
Does "%load_ext sage" not invoke the Sage preparser?
petropolisFri, 27 Jun 2014 22:57:11 -0500http://ask.sagemath.org/question/11073/How to get the same environment in "sage -ipython notebook" as in "sage"?http://ask.sagemath.org/question/10894/how-to-get-the-same-environment-in-sage-ipython-notebook-as-in-sage/If I start the command line version of sage with **sage** and type
integrate(x^2,x)
I get
1/3*x^3
as desired.
<br>
However, if I start sage in IPython's notebook with **sage -ipython notebook** and type the same thing I get
NameError: name 'integrate' is not defined
Trying to fix this by defining some prerequisites
from sage.all import *
,var x
I now get
RuntimeError: Use ** for exponentiation, not '^', which means xor
in Python, and has the wrong precedence.
<br>
**In other words, it is clear that *sage -ipython notebook* does not provide the same environment as *sage*.**
<h1>How can I fix this? I just want an IPython notebook that works like my sage command line.</h1>testtest2Wed, 08 Jan 2014 00:58:50 -0600http://ask.sagemath.org/question/10894/is it possible to run a sage in ipython notebook?http://ask.sagemath.org/question/10666/is-it-possible-to-run-a-sage-in-ipython-notebook/I want run some sage commands in ipython notebook (in cloud.sagemath.com), is it possible?
And the same question but local, i.e., using ipython notebook via canopy and insert some command of sage.
Thanks.hsigristSun, 27 Oct 2013 15:28:21 -0500http://ask.sagemath.org/question/10666/