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

Cannot start jupyter notebook #4303

Closed
vrastil opened this issue Dec 27, 2018 · 5 comments
Closed

Cannot start jupyter notebook #4303

vrastil opened this issue Dec 27, 2018 · 5 comments

Comments

@vrastil
Copy link

vrastil commented Dec 27, 2018

When I try to start (any) jupyter notebook directly, I get the following error:

 Traceback (most recent call last):
  File "/usr/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/jupyter_core/application.py",     line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python2.7/site-    packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/lib/python2.7/site-packages/notebook/notebookapp.py",     line 1784, in start
    self.launch_browser()
  File "/usr/lib/python2.7/site-packages/notebook/notebookapp.py",     line 1742, in launch_browser
    with open(fd, 'w', encoding='utf-8') as fh:
TypeError: coercing to Unicode: need string or buffer, int found

However, if I only start jupyter on some directory, I can open notebooks through browser just fine.
I installed jupyter through pip (not using anaconda).

jupyter version: 4.4.0
python version: 2.7.15
OS: Fedora 29

@o-smirnov
Copy link

I confirm the problem. Offending code is here: https://github.com/jupyter/notebook/blob/master/notebook/notebookapp.py#L1749

Clearly it should be passing open_file, not fd to the open() call.

@o-smirnov
Copy link

Problem was introduced in notebook=5.7.3. Running with 5.7.2 works.

@slel
Copy link

slel commented Jan 11, 2019

The problem was introduced in #4260 and backported to the 5.7.x branch in #4265.

Fix at #4340.

@takluyver
Copy link
Member

Passing fd was intentional, but I hadn't realised that that was a new feature on Python 3.

@takluyver takluyver added this to the 5.7.5 milestone Jan 16, 2019
takluyver added a commit that referenced this issue Jan 16, 2019
Use io.open in notebookapp.py to fix #4303
@slel
Copy link

slel commented Jan 16, 2019

In the end the fix is at #4349 and should be part of
notebook 5.7.5 when it is released.

@minrk minrk closed this as completed Mar 5, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants