nvidia-docker icon indicating copy to clipboard operation
nvidia-docker copied to clipboard

jupyter notebook "could not locate runnable browser" in Nvidia TensorRT docker

Open minertom opened this issue 3 years ago • 2 comments

I loaded the Nvidia docker for TensorRT and I can run inference when I do not use the jupyter notebook.

But when I attempt to use the jupyter notebook get an error "could not locate runnable browser"

Having had this problem once before in another application I was able to fix the problem with

Add this line to your jupyter_notebook_config.py file: c.NotebookApp.use_redirect_file = False

However, in the docker environment I can not find the jupyter notebook configuration file.

Thank You Tom

minertom avatar Jan 13 '22 01:01 minertom

@minertom this is not something specific to the NVIDIA Container Toolkit. Is there a TensorRT repo / forum that you could post the question to?

elezar avatar Jan 13 '22 09:01 elezar

You can refer to this

  • https://github.com/chaiyd/docker/tree/master/conda

chaiyd avatar Jan 18 '22 06:01 chaiyd

Webbrowser is part of the python standard library, you don't have to install a separate package to use it because it comes bundled with your python installation. If you want to get recognized browsers on your system:

import webbrowser
print webbrowser._browsers

If you directly use webbrowser.open() - it will always open the link in the default browser. What you can do is to register the any other browser and then launch a new tab. Something like this:

webbrowser.register(name, constructor, instance=None)

Once a python browser type is registered, the get() function can return a controller for that browser type. You can run open, open_new and open_new_tab on the controller object. This will ensure the

commands are executed on the same browser instance you opened.

import webbrowser    
url='https://www.google.com'
chrome_path="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
webbrowser.register('chrome', None,webbrowser.BackgroundBrowser(chrome_path),1)
webbrowser.get('chrome').open_new_tab(url)

gilbertcane avatar Oct 31 '22 04:10 gilbertcane