question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

open_browser=False doesn't work anymore

See original GitHub issue

Up until the new version 3 c.LabApp.open_browser = False used to work when starting jupyter-lab. The setting is now c.ServerApp.open_browser and it defaults to False but a browser window is opened every time I start jupyter-lab.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JohnPatoncommented, Feb 19, 2021

I’m encountering this issue now. I’m not able to start jupyter lab in a headless environment despite having open_browser=False in my config files:

$ pip freeze | grep jupy
jupyter-client==6.1.11
jupyter-core==4.7.1
jupyter-resource-usage==0.5.1
jupyter-server==1.4.0
jupyterlab==3.0.8
jupyterlab-pygments==0.1.2
jupyterlab-server==2.2.1
jupytext==1.10.2

$ cat ~/.jupyter/jupyter_server_config.py | grep browser
c.NotebookApp.open_browser = False
c.ServerApp.open_browser = False

$ jupyter lab
[I 2021-02-19 10:17:11.664 ServerApp] jupyter_resource_usage | extension was successfully linked.
[W 2021-02-19 10:17:11.672 LabApp] 'token' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.672 LabApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.672 LabApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.672 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.
[W 2021-02-19 10:17:11.672 LabApp] 'allow_root' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.672 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.672 LabApp] 'allow_origin_pat' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.673 LabApp] 'allow_remote_access' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.673 LabApp] 'disable_check_xsrf' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.673 LabApp] 'base_url' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2021-02-19 10:17:11.682 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-02-19 10:17:11.682 ServerApp] jupytext | extension was successfully linked.
[W 2021-02-19 10:17:11.686 NotebookApp] 'token' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.686 NotebookApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.686 NotebookApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'allow_root' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'allow_origin_pat' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'allow_remote_access' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'disable_check_xsrf' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-19 10:17:11.687 NotebookApp] 'base_url' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2021-02-19 10:17:11.971 ServerApp] nbresuse | extension was found and enabled by nbclassic. Consider moving the extension to Jupyter Server's extension paths.
[I 2021-02-19 10:17:11.971 ServerApp] nbresuse | extension was successfully linked.
[I 2021-02-19 10:17:11.971 ServerApp] nbclassic | extension was successfully linked.
[W 2021-02-19 10:17:11.990 ServerApp] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 2021-02-19 10:17:11.994 ServerApp] jupyter_resource_usage | extension was successfully loaded.
[I 2021-02-19 10:17:11.995 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.7/site-packages/jupyterlab
[I 2021-02-19 10:17:11.995 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 2021-02-19 10:17:11.999 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-02-19 10:17:11.999 ServerApp] [Jupytext Server Extension] Deriving a JupytextContentsManager from LargeFileManager
[I 2021-02-19 10:17:12.001 ServerApp] jupytext | extension was successfully loaded.
[I 2021-02-19 10:17:12.006 ServerApp] nbclassic | extension was successfully loaded.
[W 2021-02-19 10:17:12.006 ServerApp] nbresuse | extension failed loading with message: Duplicated timeseries in CollectorRegistry: {'total_memory_usage'}
[I 2021-02-19 10:17:12.006 ServerApp] Serving notebooks from local directory: /some/directory
[I 2021-02-19 10:17:12.007 ServerApp] Jupyter Server 1.4.0 is running at:
[I 2021-02-19 10:17:12.007 ServerApp] http://localhost:8080/lab
[I 2021-02-19 10:17:12.007 ServerApp]  or http://127.0.0.1:8080/lab
[I 2021-02-19 10:17:12.007 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/jupyter_server/serverapp.py", line 2018, in launch_browser
    browser = webbrowser.get(self.browser or None)
  File "/usr/local/lib/python3.7/webbrowser.py", line 65, in get
    raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-lab", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/jupyter_server/extension/application.py", line 520, in launch_instance
    serverapp.start()
  File "/usr/local/lib/python3.7/site-packages/jupyter_server/serverapp.py", line 2100, in start
    self.start_app()
  File "/usr/local/lib/python3.7/site-packages/jupyter_server/serverapp.py", line 2059, in start_app
    self.launch_browser()
  File "/usr/local/lib/python3.7/site-packages/jupyter_server/serverapp.py", line 2020, in launch_browser
    self.log.warning(_('No web browser found: %s.') % e)
UnboundLocalError: local variable '_' referenced before assignment

Note that I have the properties duplicated over c.NotebookApp and c.ServerApp because this config file is being used for different jupyter versions, but I don’t think that should matter.

Any ideas?

1reaction
Zsailercommented, Jan 7, 2021

Things should be better now by upgrading jupyter_server, i.e. pip install -U jupyter_server.

You’ll temporarily get a warning that looks like:

'open_browser' is found in LabApp, NotebookApp, and ServerApp. This is a recent change.This config will only be set in LabApp. Please check if you should also config these traits in NotebookApp and ServerApp for your purpose.

until nbclassic handles this trait.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open Browser Error 2019.10.0 Beta484 - Help
The open browser activity doesn't work anymore. Ill post a screenshot bellow. The error message says: “Open Browser: Cannot communicate with ...
Read more >
Can Selenium WebDriver open browser windows silently in ...
If you are using Selenium web driver with Python, you can use PyVirtualDisplay, a Python wrapper for Xvfb and Xephyr.
Read more >
App is not loading when running remotely - Streamlit Docs
Symptom #1: The app never loads ... If that still doesn't solve the problem, try running a simple HTTP server instead of Streamlit,...
Read more >
What to do when things go wrong - The Jupyter Notebook
Jupyter doesn't load or doesn't work in the browser · Try in another browser (e.g. if you normally use Firefox, try...
Read more >
bash - Open browser in host system from Windows Subsystem ...
You still have to set export BROWSER=wslview in .bashrc or .profile or similar. You can on Ubuntu start the default browser with wslview...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found