0

没有使用 Anaconda 是自己安装的 python 然后直接在 terminal 里面通过 pip 下载的 IPython

pip install ipython

也能看到安装成功

Harrys-MacBook-Pro:~ harry.$ ipython
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

接着用 pip 安装 jupyter

pip install jupyter

但是在运行 jupyter notebook 的时候总是失败,也没有查到相关的解决方法

Harrys-MacBook-Pro:~ harry.$ 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/site-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/site-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/site-packages/traitlets/config/application.py", line 89, in catch_config_error
    app.print_help()
  File "/usr/local/lib/python2.7/site-packages/traitlets/config/application.py", line 385, in print_help
    self.print_subcommands()
  File "/usr/local/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)

请问各位这个时候应该怎么处理啊?

awc789 37
2019-01-11 提问
1 个回答
0

参考 https://blog.csdn.net/Ehcoing...

通过打开 python27/Lib 文件夹下的 site.py 文件, 在文件开头加入三行:

import sys
reload(sys)
sys.setdefaultencoding('utf-8')

问题得到解决

撰写答案

你可能感兴趣的

推广链接