Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?

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?

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