1. 程式人生 > >python3 關於問題jupyter notebook Traceback (most recent call last)

python3 關於問題jupyter notebook Traceback (most recent call last)

遇到用pip安裝完jupyter 然後執行jupyter notebook命令,出現以下錯誤:

Traceback (most recent call last):
  File "e:\py3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\py3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\py3\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module>
  File "e:\py3\lib\site-packages\notebook\notebookapp.py", line 38, in <module>
    from jinja2 import Environment, FileSystemLoader
  File "e:\py3\lib\site-packages\jinja2\__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "e:\py3\lib\site-packages\jinja2\environment.py", line 15, in <module>
    from jinja2 import nodes
  File "e:\py3\lib\site-packages\jinja2\nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "e:\py3\lib\site-packages\jinja2\utils.py", line 647, in <module>
    from markupsafe import Markup, escape, soft_unicode
  File "e:\py3\lib\site-packages\markupsafe\__init__.py", line 14, in <module>
    from markupsafe._compat import text_type, string_types, int_types, \
ModuleNotFoundError: No module named 'markupsafe._compat'

 網上查資料,發現是markupsafe有問題,解除安裝重灌還是有問題,再搜尋有人說是編碼問題,我之前在裝jupyter就

過python3裡的__init__.py程式碼改utf-8為gbk,難道又要改?仔細看了看原文

 (http://blog.csdn.net/candcplusplus/article/details/72793591),

作者是用Git bash成功了,我想了想沒用git bash,下面有評論轉換cmd命令:chcp 65001 

,也就是將cmd轉化為utf-8,嘗試了下,然後重灌markupsafe 然後啟動notebook,成功了