jupyter / jupyter/notebook

SyntaxError with Python 2

Open
#4,644 7 comments 2 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

Hi! I've installed Python 2.7.15 on Ubuntu and installed latest `jupyter` package.
I'm getting the following error when executing `jupyter notebook`:
```
/home/user/work/jupyter_env/pythons/py27_jupyter/bin/jupyter notebook

Traceback (most recent call last):
File "/home/user/work/jupyter_env/pythons/py27_jupyter/bin/jupyter-notebook", line 6, in
from notebook.notebookapp import main
File "/home/user/work/jupyter_env/pythons/py27_jupyter/lib/python2.7/site-packages/notebook/__init__.py", line 25, in
from .nbextensions import install_nbextension
File "/home/user/work/jupyter_env/pythons/py27_jupyter/lib/python2.7/site-packages/notebook/nbextensions.py", line 610, in
from .extensions import (
File "/home/user/work/jupyter_env/pythons/py27_jupyter/lib/python2.7/site-packages/notebook/extensions.py", line 8, in
from tornado.log import LogFormatter
File "/home/user/.local/lib/python2.7/site-packages/tornado/log.py", line 55
def _stderr_supports_color() -> bool:
^
SyntaxError: invalid syntax
```

It looks like the problem is related to tornado 6 and this issue: #4439

Contributor guide

Open the contributing guide

Research direction

Start with the traceback through notebook/nbextensions.py, notebook/extensions.py, and tornado/log.py, then read related issue #4439. Reproduce the failure with Python 2.7 and the reported Jupyter setup; done means launching `jupyter notebook` no longer raises this SyntaxError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.