Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Jupyter broken?

Hi all,

I have sage 8.1 installed on Ubuntu 18.04. It works fine from the terminal, the deprecated notebook seems to work correctly as well. Hoewever when I launch sage -n jupyter and try to open/create an ipynb file, I get Error 500 : Internal Server Error.

Below, what I obtain from the terminal.

I certainly broke something during the weekend, I was trying to get the hide_code extension to work, and I clearly did something that I should not. I don't know precisely what, but I tried to intall jupyter lab, and many other manipulations.

Any suggestion?

Thanks in advance!

| SageMath version 8.1, Release Date: 2017-12-07 │

│ Type "notebook()" for the browser-based notebook interface. │

│ Type "help()" for help. │

Please wait while the Sage Jupyter Notebook server starts... [I 21:49:57.150 NotebookApp] Serving notebooks from local directory: /home/jcb/Programs/sage-9.0-Ubuntu_18.04-x86_64/SageMath [I 21:49:57.150 NotebookApp] The Jupyter Notebook is running at: [I 21:49:57.150 NotebookApp] http://localhost:8888/?token=a995f9383f44bf87328a51ec7c485d66291a30d767b6c300 [I 21:49:57.150 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 21:49:57.153 NotebookApp]

To access the notebook, open this file in a browser:
    file:///run/user/1000/jupyter/nbserver-9699-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=a995f9383f44bf87328a51ec7c485d66291a30d767b6c300

[E 21:50:00.737 NotebookApp] Uncaught exception GET /notebooks/Solution%20HW%202.ipynb (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Solution%20HW%202.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language': 'en-US,fr;q=0.8,fr-FR;q=0.5,en;q=0.3', 'Accept-Encoding': 'gzip, deflate', 'Host': 'localhost:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0', 'Dnt': '1', 'Connection': 'keep-alive', 'Referer': 'http://localhost:8888/tree', 'Cookie': '_xsrf=2|1ef6e0c6|2bc38f124ecde97c63229dcd9de8acda|1584407710; username-localhost-8888="2|1:0|10:1584409798|23:username-localhost-8888|44:NTIzOTM5Y2RjZTJmNDhhNGE2YTNmZWY2NzIzZDI1MWY=|cc0b12fe88f77bd735fe9070118c65c7024118844720183814181f7580f2fece"; nb_session_8080=; session="D9eNhlV5PMxd9n2hflzUFryn3JI=?username=UydhZG1pbicKcDAKLg=="', 'If-None-Match': '"21077a6067358d005f934763e4f926c92455886e"', 'Upgrade-Insecure-Requests': '1'}) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1510, in _execute result = method(self.path_args, self.path_kwargs) File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 2898, in wrapper return method(self, *args, *kwargs) File "/home/jcb/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 59, in get get_custom_frontend_exporters=get_custom_frontend_exporters File "/home/jcb/.local/lib/python2.7/site-packages/notebook/base/handlers.py", line 519, in render_template return template.render(ns) File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/home/jcb/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code {% extends "page.html" %} File "/home/jcb/.local/lib/python2.7/site-packages/notebook/templates/page.html", line 154, in top-level template code {% block header %} File "/home/jcb/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 120, in block "header" {% for exporter in get_custom_frontend_exporters() %} File "/home/jcb/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 24, in get_custom_frontend_exporters exporter = get_exporter(name)() File "/usr/lib/python2.7/dist-packages/nbconvert/exporters/base.py", line 95, in get_exporter return entrypoints.get_single('nbconvert.exporters', name).load() File "/usr/lib/python2.7/dist-packages/entrypoints.py", line 74, in load mod = import_module(self.module_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/__init__.py", line 1, in <module> from hide_code.hide_code_html_exporter import HideCodeHTMLExporter File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module> from hide_code.hide_code_html_exporter import HideCodeHTMLExporter ImportError: No module named hide_code_html_exporter [E 21:50:00.743 NotebookApp] { "Accept-Language": "en-US,fr;q=0.8,fr-FR;q=0.5,en;q=0.3", "Accept-Encoding": "gzip, deflate", "Host": "localhost:8888", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0", "Dnt": "1", "Connection": "keep-alive", "Referer": "http://localhost:8888/tree", "Cookie": "_xsrf=2|1ef6e0c6|2bc38f124ecde97c63229dcd9de8acda|1584407710; username-localhost-8888=\"2|1:0|10:1584409798|23:username-localhost-8888|44:NTIzOTM5Y2RjZTJmNDhhNGE2YTNmZWY2NzIzZDI1MWY=|cc0b12fe88f77bd735fe9070118c65c7024118844720183814181f7580f2fece\"; nb_session_8080=; session=\"D9eNhlV5PMxd9n2hflzUFryn3JI=?username=UydhZG1pbicKcDAKLg==\"", "If-None-Match": "\"21077a6067358d005f934763e4f926c92455886e\"", "Upgrade-Insecure-Requests": "1" } [E 21:50:00.744 NotebookApp] 500 GET /notebooks/Solution%20HW%202.ipynb (127.0.0.1) 132.96ms referer=http://localhost:8888/tree

Jupyter broken?

Hi all,

I have sage 8.1 installed on Ubuntu 18.04. It works fine from the terminal, the deprecated notebook seems to work correctly as well. Hoewever when I launch sage -n jupyter and try to open/create an ipynb file, I get Error 500 : Internal Server Error.

Below, what I obtain from the terminal.

I certainly broke something during the weekend, I was trying to get the hide_code extension to work, and I clearly did something that I should not. I don't know precisely what, but I tried to intall jupyter lab, and many other manipulations.

Any suggestion?

P.s. I edited, as per Sébastien's anwer.

Thanks in advance!

| SageMath version 8.1, Release Date: 2017-12-07 │

│ Type "notebook()" for the browser-based notebook interface. │

│ Type "help()" for help. │

Please wait while the Sage Jupyter Notebook server starts... [I 21:49:57.150 NotebookApp] Serving notebooks from local directory: /home/jcb/Programs/sage-9.0-Ubuntu_18.04-x86_64/SageMath [I 21:49:57.150 NotebookApp] The Jupyter Notebook is running at: [I 21:49:57.150 NotebookApp] http://localhost:8888/?token=a995f9383f44bf87328a51ec7c485d66291a30d767b6c300 [I 21:49:57.150 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 21:49:57.153 NotebookApp]

To access the notebook, open this file in a browser:
    file:///run/user/1000/jupyter/nbserver-9699-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/?token=a995f9383f44bf87328a51ec7c485d66291a30d767b6c300

[E 21:50:00.737 NotebookApp] Uncaught exception GET /notebooks/Solution%20HW%202.ipynb (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Solution%20HW%202.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language': 'en-US,fr;q=0.8,fr-FR;q=0.5,en;q=0.3', 'Accept-Encoding': 'gzip, deflate', 'Host': 'localhost:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0', 'Dnt': '1', 'Connection': 'keep-alive', 'Referer': 'http://localhost:8888/tree', 'Cookie': '_xsrf=2|1ef6e0c6|2bc38f124ecde97c63229dcd9de8acda|1584407710; username-localhost-8888="2|1:0|10:1584409798|23:username-localhost-8888|44:NTIzOTM5Y2RjZTJmNDhhNGE2YTNmZWY2NzIzZDI1MWY=|cc0b12fe88f77bd735fe9070118c65c7024118844720183814181f7580f2fece"; nb_session_8080=; session="D9eNhlV5PMxd9n2hflzUFryn3JI=?username=UydhZG1pbicKcDAKLg=="', 'If-None-Match': '"21077a6067358d005f934763e4f926c92455886e"', 'Upgrade-Insecure-Requests': '1'}) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1510, in _execute result = method(self.path_args, self.path_kwargs) File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 2898, in wrapper return method(self, *args, *kwargs) File "/home/jcb/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 59, in get get_custom_frontend_exporters=get_custom_frontend_exporters File "/home/jcb/.local/lib/python2.7/site-packages/notebook/base/handlers.py", line 519, in render_template return template.render(ns) File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/home/jcb/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code {% extends "page.html" %} File "/home/jcb/.local/lib/python2.7/site-packages/notebook/templates/page.html", line 154, in top-level template code {% block header %} File "/home/jcb/.local/lib/python2.7/site-packages/notebook/templates/notebook.html", line 120, in block "header" {% for exporter in get_custom_frontend_exporters() %} File "/home/jcb/.local/lib/python2.7/site-packages/notebook/notebook/handlers.py", line 24, in get_custom_frontend_exporters exporter = get_exporter(name)() File "/usr/lib/python2.7/dist-packages/nbconvert/exporters/base.py", line 95, in get_exporter return entrypoints.get_single('nbconvert.exporters', name).load() File "/usr/lib/python2.7/dist-packages/entrypoints.py", line 74, in load mod = import_module(self.module_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/__init__.py", line 1, in <module> from hide_code.hide_code_html_exporter import HideCodeHTMLExporter File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module> from hide_code.hide_code_html_exporter import HideCodeHTMLExporter ImportError: No module named hide_code_html_exporter [E 21:50:00.743 NotebookApp] { "Accept-Language": "en-US,fr;q=0.8,fr-FR;q=0.5,en;q=0.3", "Accept-Encoding": "gzip, deflate", "Host": "localhost:8888", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0", "Dnt": "1", "Connection": "keep-alive", "Referer": "http://localhost:8888/tree", "Cookie": "_xsrf=2|1ef6e0c6|2bc38f124ecde97c63229dcd9de8acda|1584407710; username-localhost-8888=\"2|1:0|10:1584409798|23:username-localhost-8888|44:NTIzOTM5Y2RjZTJmNDhhNGE2YTNmZWY2NzIzZDI1MWY=|cc0b12fe88f77bd735fe9070118c65c7024118844720183814181f7580f2fece\"; nb_session_8080=; session=\"D9eNhlV5PMxd9n2hflzUFryn3JI=?username=UydhZG1pbicKcDAKLg==\"", "If-None-Match": "\"21077a6067358d005f934763e4f926c92455886e\"", "Upgrade-Insecure-Requests": "1" } [E 21:50:00.744 NotebookApp] 500 GET /notebooks/Solution%20HW%202.ipynb (127.0.0.1) 132.96ms referer=http://localhost:8888/treehide_code_html_exporter

Jupyter broken?

Hi all,

I have sage 8.1 installed on Ubuntu 18.04. It works fine from the terminal, the deprecated notebook seems to work correctly as well. Hoewever when I launch sage -n jupyter and try to open/create an ipynb file, I get Error 500 : Internal Server Error.

Below, what I obtain from the terminal.

I certainly broke something during the weekend, I was trying to get the hide_code extension to work, and I clearly did something that I should not. I don't know precisely what, but I tried to intall jupyter lab, and many other manipulations.

Any suggestion?

P.s. I edited, as per Sébastien's anwer.

Thanks in advance!

| SageMath version 8.1, Release Date: 2017-12-07 │

│ Type "notebook()" for the browser-based notebook interface. │

│ Type "help()" for help. │

Please wait while the Sage Jupyter Notebook server starts... File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module> from hide_code.hide_code_html_exporter import HideCodeHTMLExporter ImportError: No module named hide_code_html_exporter

Jupyter broken?How to install hide_code in SageMath?

Hi all,

I have sage 8.1 installed on Ubuntu 18.04. It works fine from the terminal, the deprecated notebook seems to work correctly as well. Hoewever when I launch sage -n jupyter and try to open/create an ipynb file, I get Error 500 : Internal Server Error.

Below, what I obtain from the terminal.

I certainly broke something during the weekend, I was trying to get the hide_code extension to work, and I clearly did something that I should not. I don't know precisely what, but I tried to intall jupyter lab, and many other manipulations.

Any suggestion?

P.s. Edit 1 I edited, as per Sébastien's anwer.first answer.

Edit 2 My question deviated towards the installation of hide_code for jupyter. @Sebastien answered, the procedure works fine!

Thanks in advance!

| SageMath version 8.1, Release Date: 2017-12-07 │

│ Type "notebook()" for the browser-based notebook interface. │

│ Type "help()" for help. │

Please wait while the Sage Jupyter Notebook server starts... File "/home/jcb/.local/lib/python2.7/site-packages/hide_code/hide_code.py", line 9, in <module> from hide_code.hide_code_html_exporter import HideCodeHTMLExporter ImportError: No module named hide_code_html_exporter