问题现象
(base) [xxx@ip-10-169-49-131 sztoc_audiencemanager]$ jupyter notebook --no-browser --port=1234
The Jupyter HTML Notebook.这将启动一个基于tornado的HTML笔记本服务器,它提供一个html5/
javascript笔记本客户端。Traceback (most recent call last):
File "/usr/share/miniconda2/envs/py27/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/opt/miniconda2/envs/py27/lib/python2.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/opt/miniconda2/envs/py27/lib/python2.7/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "</opt/miniconda2/envs/py27/lib/python2.7/site-packages/decorator.pyc:decorator-gen-7>", line 2, in initialize
File "/opt/miniconda2/envs/py27/lib/python2.7/site-packages/traitlets/config/application.py", line 89, in catch_config_error
app.print_help()
File "/opt/miniconda2/envs/py27/lib/python2.7/site-packages/traitlets/config/application.py", line 385, in print_help
self.print_subcommands()
File "/opt/miniconda2/envs/py27/lib/python2.7/site-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)
解决方法
先设置环境变量:export LANG=zn
(base) [xxx@ip-10-169-49-131 sztoc_audiencemanager]$ export LANG=zn
(base) [xxx@ip-10-169-49-131 sztoc_audiencemanager]$ jupyter notebook --no-browser --port=1234
[I 10:09:04.308 NotebookApp] Writing notebook server cookie secret to /run/user/16382/jupyter/notebook_cookie_secret
[I 10:09:05.397 NotebookApp] Serving notebooks from local directory: /ldap_home/sztoc_audiencemanager
[I 10:09:05.397 NotebookApp] The Jupyter Notebook is running at:
[I 10:09:05.397 NotebookApp] http://localhost:1234/?token=7604d4734581911da8255629777035629e5fecf27db55a67
[I 10:09:05.398 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:09:05.408 NotebookApp]To access the notebook, open this file in a browser:
file:///run/user/16382/jupyter/nbserver-43159-open.html
Or copy and paste one of these URLs:
http://localhost:1234/?token=7604d4734581911da8255629777035629e5fecf27db55a67
2770

被折叠的 条评论
为什么被折叠?



