jupyter_server
jupyter_server copied to clipboard
'port' moved from NotebookApp to ServerApp, but Jupyter ignores ServerApp.port
Description Today I installed Jupyter in a new virtual environment, and when started, it displayed the following warning:
[W 2021-02-05 15:12:00.626 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
It still worked as usual. After I changed the line:
c.NotebookApp.port = <my custom port>
in ~/.jupyter/jupyter_notebook_config.py
to:
c.ServerApp.port = <my custom port>
the warning is no more, but now Jupyter ignores the configuration and listens at the default 8888 port.
The same problem happened to other configuration variables, like password
.
To Reproduce
- Change the setting
NotebookApp.port
toServerApp.port
in the file~/.jupyter/jupyter_notebook_config.py
- Run
jupyter notebook
, and check that it outputs[I 20:16:38.282 NotebookApp] http://localhost:8888/?token=<...>
Expected behavior
The warning message 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config
led me to believe that, if I changed the config from NotebookApp
to ServerApp
, everything would still work as usual (in particular, Jupyter would listen at my custom port as specified in ServerApp.port
).
Version info:
Fedora 31 Linux 5.5.13-200.fc31.x86_64 jupyter/notebook#1 SMP Wed Mar 25 21:55:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ jupyter --version
jupyter core : 4.7.1
jupyter-notebook : 6.2.0
qtconsole : 5.0.2
ipython : 7.20.0
ipykernel : 5.4.3
jupyter client : 6.1.11
jupyter lab : 3.0.7
nbconvert : 6.0.7
ipywidgets : 7.6.3
nbformat : 5.1.2
traitlets : 5.0.5
$ python
Python 3.9.1 (default, Feb 5 2021, 15:04:29)
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] on linux
Originally opened as jupyter/notebook#5977 by @fofoni, migration requested by @Zsailer
What version of jupyter-server is installed? I'm hitting something similar with jupyter-server 1.4.1, nbclassic 0.2.6, but spawning the notebook via jupyterhub 1.2.2 with this set in the hub per the docs:
jovyan@hub-54b895fcf6-vn2kk:/$ printenv JUPYTERHUB_SINGLEUSER_APP
jupyter_server.serverapp.ServerApp
So is there any a solution to this issue? I encounter the same issues with the following version information on a Linux machine.
$ jupyter --version
Selected Jupyter core packages...
IPython : 7.30.0
ipykernel : 6.5.1
ipywidgets : 7.6.5
jupyter_client : 7.1.0
jupyter_core : 4.9.1
jupyter_server : 1.12.1
jupyterlab : 3.2.3
nbclient : 0.5.9
nbconvert : 6.3.0
nbformat : 5.1.3
notebook : 6.4.6
qtconsole : not installed
traitlets : 5.1.1
$ python
Python 3.8.12 | packaged by conda-forge | (default, Sep 29 2021, 19:52:28)
[GCC 9.4.0] on linux
After changing NotebookApp.port
to ServerApp.port
you should also rename the file to jupyter_server_config.py
and start the notebook with jupyter nbclassic
, not jupyter notebook
(that one will use the old NotebookApp
).
The original warning came from LabApp
which extends ServerApp
:
[W 2021-02-05 15:12:00.626 LabApp] 'port' has moved from NotebookApp to ServerApp.
so it must have been after starting the jupyter lab
, not jupyter notebook
.
Please see https://jupyter-server.readthedocs.io/en/latest/operators/migrate-from-nbserver.html#migrate-from-notebook and thsi answer.
I believe this should be better documented (e.g. by copy-pasting my SO answer to the docs).