Problem with Macbook unable to start jupyter notebook

do not use Anaconda python is installed by yourself and then download IPython

directly through pip in terminal .
pip install ipython

you can also see the successful installation

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.

then use pip to install jupyter

pip install jupyter

but always fails when running jupyter notebook , and no relevant solutions are found

Harrys-MacBook-Pro:~ harry.$ jupyter notebook
The Jupyter HTML Notebook.

tornadoHTMLhtml5/
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)

what should you do at this time?


refer to https://blog.csdn.net/Ehcoing...

add three lines at the beginning of the file by opening the site.py file in the python27/Lib folder:

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

problem solved

Menu