0
matplotlib導入錯誤。在Windows 10上運行的Python 2.7 32位。我試過pip卸載matplotlib並重新安裝,但同樣的錯誤不斷出現。無法導入名稱pyplot
我已經嘗試了導入命令的所有變體。 請幫忙!
代碼:
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('messi5.jpg',0)
plt.imshow(img, cmap = 'gray', interpolation = 'bicubic')
plt.show()
錯誤:
C:\Python27\python.exe C:/Users/Anand/PycharmProjects/test1/matplotlib.py
Traceback (most recent call last):
File "C:/Users/Anand/PycharmProjects/test1/matplotlib.py", line 2, in <module>
from matplotlib import pyplot as plt
File "C:\Users\Anand\PycharmProjects\test1\matplotlib.py", line 2, in <module>
from matplotlib import pyplot as plt
ImportError: cannot import name pyplot
過程與退出代碼完成1
發佈的進口代碼的相關行和錯誤消息。 – PJW