vscode matplotlib

ModuleNotFoundError: No module named ‘tkinter’

solver

#%%
import matplotlib

ubuntu

sudo apt install python3-tk

or
# don't show so we should save the image
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt


....

plt.savefig(path)

猜你喜欢

转载自blog.csdn.net/he_wen_jie/article/details/81031647