matplotlib报错no display name and no $DISPLAY environment variable解决方案
# import this before everything
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
plt.figure() # now is ok
# import this before everything
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
plt.figure() # now is ok