这段代码:
from matplotlib import pyplot as plt
直到现在一直工作良好。当我使用这段代码运行每个文件时,它们会运行到此代码行,然后停止执行而不会发出错误信号。它就像文件在该行结束一样工作。我的 matplotlib 版本是 1.2.0 和 numpy 1.6.2。我该如何解决?重新安装模块?
更新:
from __future__ import division
import os
import glob
import scipy
import numpy as np
import pymorph as pm
#import pylab as plb
#import math
import matplotlib
print("before matplot")
from matplotlib import pyplot as plt
print("after matplot")
import cv2
import mahotas as mh
from skimage import morphology
from math import sqrt
import copy
#... the others code's lines (1700 lines of code) are runned only if
#"from matplotlib import pyplot as plt" is commented
输出:
>>> ================================ RESTART ================================
>>>
before matplot
>>> ================================ RESTART ================================
>>>
更新 2:
import matplotlib.pyplot as plt; plt.figure(); plt.show()
从 python Shell 工作并打开一个灰色窗口,下面有命令栏
<matplotlib.figure.Figure object at 0x03741B70>