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

Ubuntu16.04 launching UnicodeDecodeError #4166

Closed
xyangk opened this issue Nov 4, 2018 · 2 comments
Closed

Ubuntu16.04 launching UnicodeDecodeError #4166

xyangk opened this issue Nov 4, 2018 · 2 comments

Comments

@xyangk
Copy link

xyangk commented Nov 4, 2018

xiao@xiao-ubuntu:~$ jupyter notebook --debug
[D 11:27:12.526 NotebookApp] Searching [u'/home/xiao', '/home/xiao/.jupyter', '/usr/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 11:27:12.526 NotebookApp] Looking for jupyter_config in /etc/jupyter
[D 11:27:12.526 NotebookApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 11:27:12.526 NotebookApp] Looking for jupyter_config in /usr/etc/jupyter
[D 11:27:12.526 NotebookApp] Looking for jupyter_config in /home/xiao/.jupyter
[D 11:27:12.526 NotebookApp] Looking for jupyter_config in /home/xiao
[D 11:27:12.527 NotebookApp] Looking for jupyter_notebook_config in /etc/jupyter
[D 11:27:12.527 NotebookApp] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 11:27:12.527 NotebookApp] Looking for jupyter_notebook_config in /usr/etc/jupyter
[D 11:27:12.527 NotebookApp] Looking for jupyter_notebook_config in /home/xiao/.jupyter
[D 11:27:12.527 NotebookApp] Looking for jupyter_notebook_config in /home/xiao
The Jupyter HTML Notebook.

这将启动一个基于tornado的HTML笔记本服务器,它提供一个html5/
javascript笔记本客户端。

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 89, in catch_config_error
    app.print_help()
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 385, in print_help
    self.print_subcommands()
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 377, in print_subcommands
    print(os.linesep.join(lines))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 4: ordinal not in range(128)

I found similar issue here

xiao@xiao-ubuntu:~$ python -V
Python 2.7.12
xiao@xiao-ubuntu:~$ pip -V
pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

This is my output of notebook.transutils

xiao@xiao-ubuntu:~$ jupyter notebook --version
5.7.0
xiao@xiao-ubuntu:~$ python -c "from notebook.transutils import trans, _; print(_('Untitled'))"
未命名

I tried this , but doesn't work

xiao@xiao-ubuntu:~$ LANG=zn jupyter notebook
The Jupyter HTML Notebook.

这将启动一个基于tornado的HTML笔记本服务器,它提供一个html5/
javascript笔记本客户端。

Traceback (most recent call last):
 File "/usr/local/bin/jupyter-notebook", line 11, in <module>
   sys.exit(main())
 File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 266, in launch_instance
   return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 657, in launch_instance
   app.initialize(argv)
 File "<decorator-gen-7>", line 2, in initialize
 File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 89, in catch_config_error
   app.print_help()
 File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 385, in print_help
   self.print_subcommands()
 File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 377, in print_subcommands
   print(os.linesep.join(lines))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 4: ordinal not in range(128)

@Carreau
Copy link
Member

Carreau commented Nov 4, 2018

You are using Python 2.7, please upgrade to Python 3.

@Carreau Carreau closed this as completed Nov 4, 2018
@embray
Copy link
Contributor

embray commented Jan 15, 2019

In case any Chinese users would like any actually useful help with this issue, while you should upgrade to using Python 3 versions of Jupyter if possible, if you cannot upgrade for whatever reason: try setting the environment variable LANGUAGE=en_US so that Jupyter doesn't try to use its Chinese translation, which clearly doesn't work well on Python 2. Or if that doesn't work, try one of LC_ALL, LC_MESSAGES, or LANG as described here: https://docs.python.org/2/library/gettext.html#gettext.bindtextdomain

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

No branches or pull requests

3 participants