首页 > 解决方案 > AttributeError:模块 matplotlib 没有属性 _tri

问题描述

我正在尝试在我的 conda 环境(Python 3.6)中使用 Matplotlib,但出现此错误。有谁知道如何解决这个问题?

import matplotlib.pyplot as plt

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
   ....
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\tri\triangulation.py in <module>()
  4 import six
  5 
----> 6 import matplotlib._tri as _tri
  7 import matplotlib._qhull as _qhull
  8 import numpy as np

AttributeError: module 'matplotlib' has no attribute '_tri'

如果我需要发布错误的更多详细信息,请告诉我。

标签: pythonmatplotlibcondaattributeerror

解决方案


我觉得你的二进制文件不匹配,不幸的是,我无法重现你的错误,因为我的工作正常。

(1): 也许尝试卸载 matplotlib 然后重新安装

conda uninstall matplotlib

conda install matplotlib

(2) 尝试输出conda listconda info然后分析它,或者把它贴在这里也许我们可以分析它?

(3)尝试以下命令,也许它们会起作用:

conda update --all

(4) 如果这不起作用,请卸载 Anaconda 并尝试重新安装最新版本。


推荐阅读