jupyter / help

:sparkles: Need some help or have some questions? Please visit our Discourse page.
https://discourse.jupyter.org
291 stars 97 forks source link

Getting a TypeError when running jupyter #442

Open sdushantha opened 5 years ago

sdushantha commented 5 years ago

I keep on getting a TypeError when running jupyter notebook Here is what is happening:

$ jupyter notebook

[I 13:43:04.643 NotebookApp] Serving notebooks from local directory: /home/siddharth
[I 13:43:04.643 NotebookApp] The Jupyter Notebook is running at:
[I 13:43:04.643 NotebookApp] http://localhost:8888/?token=4c662a1ee3bee85a59e0ce1fbea615d10e472a1d36affe96
[I 13:43:04.643 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>
    sys.exit(main())
  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 1697, 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

And, I am currently running version 4.4.0:

$ jupyter --version
4.4.0
Nicholas-Autio-Mitchell commented 5 years ago

I am also getting the same error message. I tried the proposed solution in this issue here, but it did not help

My conda environment in Ubuntu 16.06 with the following versions:

python 3.7.0
Jupyter 4.4.0

and the following conda info

$ conda info

             platform : linux-64
          conda version : 4.3.30
       conda is private : False
      conda-env version : 4.3.30
    conda-build version : not installed
         python version : 3.6.0.final.0
       requests version : 2.14.2
...
    netrc file : None
           offline mode : False
             user-agent : conda/4.3.30 requests/2.14.2 CPython/3.6.0 Linux/4.15.4-041504-generic debian/stretch/sid glibc/2.23    
                UID:GID : 1000:1000
minrk commented 5 years ago

Do you have a BROWSER environment variable defined?

sdushantha commented 5 years ago

@minrk Yes I do. Am I not supposed to have it?

$ echo $BROWSER
firefox
minrk commented 5 years ago

It looks like this is a bug in the Python 3.7 webbrowser module.

Nicholas-Autio-Mitchell commented 5 years ago

There are other issues about this. Currently, I believe you have to stick to python 3.6.6 to be able to use the latest Jupyter.

I did hack the function producing the error to simply receive the correct number of arguments, and it all worked... Probably not recommended though, it just allowed me to continue without Internet for new installations etc.

sdushantha commented 5 years ago

Not sure what happened, but I updated my whole system (Manjaro Linux) and everything seems to work perfectly now.