Ask Your Question
1

Sage Notebook crashes immediately

asked 2019-04-10 06:57:42 +0100

rixenso gravatar image

updated 2023-01-09 23:59:50 +0100

tmonteil gravatar image

New installation of Windows binaries, version 8.6 (Windows installer 0.4.2), on 64-bit Windows 8.1 system with 8GB of RAM. Clicking on the "SageMath 8.6 Notebook" desktop icon opens a terminal window and displays the message "Please wait while the Sage Jupyter Notebook server starts", but the window closes within 2 or 3 seconds.

Would appreciate any guidance on troubleshooting - happy to study any relevant documentation if someone can point me in the right direction.

When running sage --notebook=jupyter in the shell I get:

[I 17:51:21.659 NotebookApp] Using MathJax: nbextensions/mathjax/MathJax.js Traceback (most recent call last):

File "/opt/sagemath-8.6/src/bin/sage-notebook", line 268, in <module> launcher(unknown)

File "/opt/sagemath-8.6/src/bin/sage-notebook", line 100, in __init__ main(argv)

File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/jupyter_core/application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)

File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/traitlets/config/application.py", line 657, in launch_instance app.initialize(argv)

File "<decorator-gen-7>", line 2, in initialize
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error return method(app, args, *kwargs)

File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1629, in initialize self.init_webapp()

File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1408, in init_webapp self.http_server.listen(port, self.ip)

File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 142, in listen sockets = bind_sockets(port, address=address)

File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/tornado/netutil.py", line 197, in bind_sockets sock.bind(sockaddr)
File "/opt/sagemath-8.6/local/lib/python2.7/socket.py", line 230, in meth return getattr(self._sock,name)(*args)

socket.error: [Errno 1] Operation not permitted
edit retag flag offensive close merge delete

Comments

What happens if you open the shell and run sage --notebook=jupyter manually? The window should likely stay up and maybe you'll be able to see something more useful.

Iguananaut gravatar imageIguananaut ( 2019-04-11 14:48:50 +0100 )edit

Note, you can edit your question to add these details--you don't have to break it up across comments. I will do so now.

Iguananaut gravatar imageIguananaut ( 2019-04-18 18:30:30 +0100 )edit

This could happen (although the error message is sadly useless to a non-expert) if notebook is trying to run its server on a port you don't have permission to open. This is strange though because by default the Jupyter notebook runs on port 8888 which is normally permitted for use, and if something else is already using the port the Notebook will just try different ports until it finds one it can use. Is this a computer you have full control over, or is it provided to you by an employer?

Iguananaut gravatar imageIguananaut ( 2019-04-18 18:40:09 +0100 )edit

Nevertheless you could try running with a different port. Try for example sage --notebook=jupyter --port=9999 or something. If that works I can point you to how to save that in the config file to use by default.

Iguananaut gravatar imageIguananaut ( 2019-04-18 18:44:37 +0100 )edit

Thanks for the guidance on how best to handle the large screen dump in my question - will keep that in mind going forward.

The "port=9999" trick seems to have worked - the Jupyter Notebook server starts, and I'm able to launch a new SageMath 8.6 session. Now I can proceed with studying the documentation and learning how to use it.

Thanks very much for your help!

rixenso gravatar imagerixenso ( 2019-04-20 19:00:26 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-04-23 13:47:23 +0100

Iguananaut gravatar image

To follow up on the discussion in the comments, this occurs if for some reason you don't have permission to use the default TCP port (8888) used by the Jupyter Notebook server. Opening the Sage Shell and manually running sage --notebook=jupyter --port=<portnum> where <portnum> can be some large integer (try something larger than 8888, but less than 32000) and it should work depending on your system's configuration.

The fact that this crashes rather than automatically try a different port is a bug: https://trac.sagemath.org/ticket/27715

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

Stats

Asked: 2019-04-10 06:57:42 +0100

Seen: 1,137 times

Last updated: Apr 23 '19