Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoking jupyter notebook with a notebook filename works but causes an exception #436

Closed
lumberbot-app bot opened this issue Mar 4, 2021 · 2 comments

Comments

@lumberbot-app
Copy link

lumberbot-app bot commented Mar 4, 2021

Describe the bug

It is unclear to me if one can launch jupyter notebook with a notebook filename to directly open it.

jupyter notebook <file.ipynb>

happens to work. However it causes the following exception

Error loading server extension jupyterlab
    Traceback (most recent call last):
      File "/home/callegar/PythonEnvs/Py3.8-devel/lib/python3.8/site-packages/notebook/notebookapp.py", line 1991, in init_server_extensions
        func(self)
      File "/home/callegar/PythonEnvs/Py3.8-devel/lib/python3.8/site-packages/jupyterlab/serverextension.py", line 33, in load_jupyter_server_extension
        extension.initialize()
      File "/home/callegar/PythonEnvs/Py3.8-devel/lib/python3.8/site-packages/jupyterlab/labapp.py", line 732, in initialize
        super().initialize()
      File "/home/callegar/PythonEnvs/Py3.8-devel/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 408, in initialize
        self._prepare_handlers()
      File "/home/callegar/PythonEnvs/Py3.8-devel/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 285, in _prepare_handlers
        self.initialize_handlers()
      File "/home/callegar/PythonEnvs/Py3.8-devel/lib/python3.8/site-packages/jupyterlab/labapp.py", line 661, in initialize_handlers
        relpath = os.path.relpath(self.serverapp.file_to_run, self.serverapp.root_dir)
    AttributeError: 'NotebookApp' object has no attribute 'root_dir'

To Reproduce

  1. Invoke jupyter notebook <file.ipynb>

Expected behavior
Either the jupyter notebook starts directly at the specified notebook file with no exception or an error message is provided early saying that passing a filename on the jupyter command line is unsupported (actually it has historically always worked).

Desktop (please complete the following information):

  • OS: ubuntu 20.04
  • Browser: either chrome or firefox

Originally opened as jupyter/notebook#5971 by @callegar, migration requested by @Zsailer

@Zsailer
Copy link
Member

Zsailer commented Mar 4, 2021

@callegar, can you try upgrading to JupyterLab 3.0.9 and jupyter_server 1.4.1.

This should have been fixed by #415 in jupyter_server and jupyterlab/jupyterlab#9848 in jupyterlab.

@blink1073
Copy link
Contributor

Closing as answered, cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants