python2.7 一个莫名其妙的错误

  先看看错误:

Traceback (most recent call last):
  File "/home/darkchii/文档/PycharmProjects/ml/model.py", line 3, in <module>
    import matplotlib.pyplot as plt
  File "/home/darkchii/.local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 71, in <module>
    from matplotlib.backends import pylab_setup
  File "/home/darkchii/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 16, in <module>
    line for line in traceback.format_stack()
  File "/home/darkchii/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 18, in <genexpr>
    if not line.startswith('  File "<frozen importlib._bootstrap'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 23: ordinal not in range(128)

  说是无法解码18行,23列位置上的‘字节’,我也是醉了,关键第23列是这样的:

  图中的startswith的sw的s。。。这叫我怎么改。。。

原文地址:https://www.cnblogs.com/darkchii/p/9146465.html