RuntimeError:乳胶无法处理以下字符串:b'$ 1.0 $'

时间:2018-12-21 22:55:45

标签: python matplotlib

MCVE:

import matplotlib.pyplot as plt
from matplotlib import rc

plt.rc('text', usetex = True)
plt.plot([1.0, 2.0], [3.0, 4.0])
plt.show()

引发的错误如标题中所述:

RuntimeError: latex is not able to process the following string:
b'$1.0$'


Here is the full report generated by latex:



<Figure size 432x288 with 1 Axes>

由于将usetex设置为True,因此引发了错误。如果设置为False,则不会发生错误。

我不知道为什么会发生这种情况,我认为(不确定)几周前相同的代码可以正常工作。

添加更多信息:

代码在一行中指出错误:

exc=exc.output.decode('utf-8')))

1 个答案:

答案 0 :(得分:0)

重新安装miktex可以解决此问题,尽管发生的原因未知。