plt.plot(i, error, 'ro')plt.show()
你的文件名是不是matplotlib,是改成其他文件名就行
是不是又文件名叫做matplotlib.py 如果有改个名字
不要把文件名设置为跟引用的包一个名字