notebook: TypeError: register() takes from 2 to 3 positional arguments but 4 were given
when opening jupyter notebook it shows this error
jupyter notebook
[I 11:56:10.168 NotebookApp] Serving notebooks from local directory: /home/malsym
[I 11:56:10.168 NotebookApp] 0 active kernels
[I 11:56:10.168 NotebookApp] The Jupyter Notebook is running at:
[I 11:56:10.168 NotebookApp] http://localhost:8888/?token=d789fe23acf854272ed5c9977d[XXXXXXXX]07d4c863f16d33
[I 11:56:10.168 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Traceback (most recent call last):
File "/usr/bin/jupyter-notebook", line 11, in <module>
load_entry_point('notebook==5.3.0', 'console_scripts', 'jupyter-notebook')()
File "/usr/lib/python3.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/usr/lib/python3.7/site-packages/notebook/notebookapp.py", line 1597, in start
browser = webbrowser.get(self.browser or None)
File "/usr/lib/python3.7/webbrowser.py", line 42, in get
register_standard_browsers()
File "/usr/lib/python3.7/webbrowser.py", line 567, in register_standard_browsers
cmd = _synthesize(cmdline, -1)
File "/usr/lib/python3.7/webbrowser.py", line 116, in _synthesize
register(browser, None, controller, update_tryorder)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given
my system information
os: arch linux Kernel Information: Linux 4.17.12-arch1-1-ARCH x86_64 python version: Python 3.7.0 jupyter version: 4.4.0
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (1 by maintainers)
Both jupyter notebook and jupyter-lab have this problem. As @takluyver suggest doing “unset BROWSER” in terminal first fixes the problem:
Looks like this is a bug in Python itself: https://bugs.python.org/issue31014
It sounds like it depends on the BROWSER environment variable; you might be able to work around it by unsetting that. Hopefully it will be fixed in 3.7.1.
You currently cannot create a Conda environment with python 3.7.1 along with Jupyter. If you try, it will fail or attempt to downgrade your python to 2.7 😂
On Fri, 26 Oct 2018, 17:31 Maximilian Schambach, notifications@github.com wrote:
If the above doesn’t work for you, try the following:
Given the error message, we are looking at line 116 of webbrowser.py. There I changed this:
register(browser, None, controller, update_tryorder)to this:
register(browser, None, controller, preferred=update_tryorder)Now running jupyter notebook works as expected!