Python matplotlib.pyplot中的函数不可访问
在多次重新安装matplotlib之后,我继续获得 上述代码中出现以下错误:Python matplotlib.pyplot中的函数不可访问,python,matplotlib,import,pip,anaconda,Python,Matplotlib,Import,Pip,Anaconda,在多次重新安装matplotlib之后,我继续获得 上述代码中出现以下错误: import matplotlib.pyplot as plt plt.plot(range(len(portvalues)),portvalues) 如何消除错误并访问matplotlib.pyplot中的函数?谢谢。Anaconda发行版默认安装了matplotlib。你是如何安装的?在管理员shell中尝试conda update conda-y,conda update--all-y,以及conda upda
import matplotlib.pyplot as plt
plt.plot(range(len(portvalues)),portvalues)
如何消除错误并访问matplotlib.pyplot中的函数?谢谢。Anaconda发行版默认安装了
matplotlib
。你是如何安装的?在管理员shell中尝试conda update conda-y
,conda update--all-y
,以及conda update matplotlib qt pyqt spyder-y
。首先更新conda本身,然后更新所有可用的软件包,最后特别注意matplotlib和使Spyder IDE工作所需的软件包。@berna1111谢谢。我已经按照你的建议做了,但问题仍然存在。然而,我发现在另一个Jupyter笔记本中调用plot函数时,plot函数确实起作用,奇怪的是,问题只出现在一个笔记本中。您是否使用plt
导入麻烦笔记本中的其他内容?可能是该名称正用于导入另一个模块,该模块没有plot
方法。默认情况下,Anaconda发行版已安装matplotlib
。你是如何安装的?在管理员shell中尝试conda update conda-y
,conda update--all-y
,以及conda update matplotlib qt pyqt spyder-y
。首先更新conda本身,然后更新所有可用的软件包,最后特别注意matplotlib和使Spyder IDE工作所需的软件包。@berna1111谢谢。我已经按照你的建议做了,但问题仍然存在。然而,我发现在另一个Jupyter笔记本中调用plot函数时,plot函数确实起作用,奇怪的是,问题只出现在一个笔记本中。您是否使用plt
导入麻烦笔记本中的其他内容?可能是该名称正用于导入另一个模块,一个没有plot
方法的模块。
AttributeError
Traceback (most recent call last)
《ipython-input-387-fee5ae6f6abc》 in 《module》()
1 import matplotlib.pyplot as plt
----> 2 plt.plot(range(len(portvalues)),portvalues)
AttributeError: 'module' object has no attribute 'plot'