Jupyter opens a 'dead' notebook interface: cannot create a new one, or open an existing
Question:
So after following all the instructions, the token finally worked, and I’m looking at this:
This is very embarrassing. I tried running an existing notebook:
jupyter notebook nbk.ipynb
with the same result. I also opened a new notebook within the notebook by starting a new Terminal, but it didn’t work either.
UPDATE
The server uses Linux, on the local machine I use Windows.
The original:
jupyter notebook
Get the port address (8888) and the token
then, in Windows, in cmd
run ssh
:
ssh -N -L localhost:8887:localhost:8888 username@ip
Open the chrome tab on the local machine, navigate to localhost:8887
, enter the token, get the screen below.
After @lww suggestion:
On the server, in Linux:
pip3 install virtualenv --user
mkdir awsm
cd awsm
virtualenv venv
source venv/bin/activate
Repeat the above. Same result. What did I do wrong?
Answers:
When ssh to remote server -N
means "Do not execute a remote command. This is useful for just forwarding ports."
One possible problem is that you should not use -N switch first time at least least because you will need to execute some commands like creating virtual environment installing jupyter.
Example procedure: ssh from windows 10 machine to guest virtual machine ubuntu 20.04
Working from windows terminal:
c:userslwwdesktop>ssh [email protected] -L 8888:localhost:8888
$ sudo pip3 install virtualenv --user
$ mkdir awsm && cd awsm
$ virtualenv venv
$ source venv/bin/activate
$ pip install notebook
$ jupyter notebook
Result:
OK so the problem seems to have been with the jupyter lab. I noticed jupyter is throwing an error:
Could not open static file ''
So after a bit of googling and printing out the jupyter --version
:
jupyter core : 4.5.0
jupyter-notebook : 6.0.0
qtconsole : 4.5.2
ipython : 7.7.0
ipykernel : 5.1.1
jupyter client : 5.3.1
jupyter lab : not installed
nbconvert : 5.5.0
ipywidgets : 7.5.1
nbformat : 4.4.0
traitlets : 4.3.2
Without virtualenv, I installed
pip3.5 install jupyterlab --user
pip3.5 install tornado==5.0 --user
pip3.5 install -U jupyter --user
Accessed the remote server from terminal:
ssh [email protected] -L 8889:localhost:8889
Ran jupyter: jupyter notebook --no-browser
and then opened the remote link on the local browser: http://localhost:8889
And it works!
So after following all the instructions, the token finally worked, and I’m looking at this:
This is very embarrassing. I tried running an existing notebook:
jupyter notebook nbk.ipynb
with the same result. I also opened a new notebook within the notebook by starting a new Terminal, but it didn’t work either.
UPDATE
The server uses Linux, on the local machine I use Windows.
The original:
jupyter notebook
Get the port address (8888) and the token
then, in Windows, in cmd
run ssh
:
ssh -N -L localhost:8887:localhost:8888 username@ip
Open the chrome tab on the local machine, navigate to localhost:8887
, enter the token, get the screen below.
After @lww suggestion:
On the server, in Linux:
pip3 install virtualenv --user
mkdir awsm
cd awsm
virtualenv venv
source venv/bin/activate
Repeat the above. Same result. What did I do wrong?
When ssh to remote server -N
means "Do not execute a remote command. This is useful for just forwarding ports."
One possible problem is that you should not use -N switch first time at least least because you will need to execute some commands like creating virtual environment installing jupyter.
Example procedure: ssh from windows 10 machine to guest virtual machine ubuntu 20.04
Working from windows terminal:
c:userslwwdesktop>ssh [email protected] -L 8888:localhost:8888
$ sudo pip3 install virtualenv --user
$ mkdir awsm && cd awsm
$ virtualenv venv
$ source venv/bin/activate
$ pip install notebook
$ jupyter notebook
Result:
OK so the problem seems to have been with the jupyter lab. I noticed jupyter is throwing an error:
Could not open static file ''
So after a bit of googling and printing out the jupyter --version
:
jupyter core : 4.5.0
jupyter-notebook : 6.0.0
qtconsole : 4.5.2
ipython : 7.7.0
ipykernel : 5.1.1
jupyter client : 5.3.1
jupyter lab : not installed
nbconvert : 5.5.0
ipywidgets : 7.5.1
nbformat : 4.4.0
traitlets : 4.3.2
Without virtualenv, I installed
pip3.5 install jupyterlab --user
pip3.5 install tornado==5.0 --user
pip3.5 install -U jupyter --user
Accessed the remote server from terminal:
ssh [email protected] -L 8889:localhost:8889
Ran jupyter: jupyter notebook --no-browser
and then opened the remote link on the local browser: http://localhost:8889
And it works!