Matplotlib画图需要用到Latex字体,但是使用参数配置的时候出现错误Failed to process string with tex because latex could not be found,看官方文档
https://matplotlib/2.0.2/users/usetex.html,

选中文字:MatplotlibLaTeX的支持需要电脑安装LaTex另外还需要将LaTeX添加到系统环境变量Path

想到之前觉得不用了就把TexLive软件卸载了,唉,重新安装吧。又得安装一个多小时。。。

另外,虽然需要将LaTex添加到Path中,安装之后默认就已经添加到Path中了。可以在cmd终端中用下面的命令检测:

tex -v
latex -v
xelatex -v
pdflatex -v

最后:安装好后,Matplotlib已经能用LaTeX字体了,确实是没有安装TexLive2020导致的。

更多推荐

错误Failed to process string with tex because latex could not be found