Matplotlib AttributeError: module 'matplotlib.cbook' has no attribute '_define_aliases'

前端 未结 3 2012
逝去的感伤
逝去的感伤 2020-12-17 18:07

When trying to plot a graph on jupyter with pyplot I am running the following code:

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel(\'some num         


        
相关标签:
3条回答
  • 2020-12-17 18:51

    One thing you could do to guarantee the desinstallation is delete the folder of matplotlib. In Windows you may found in:

    C:\Users\YOUR_USER\AppData\Local\Programs\Python\YOUR_PYTHON_VERSION\Lib\site-packages

    If you have a folder named 'matplotlib' delete it and them reinstall the package.

    0 讨论(0)
  • 2020-12-17 18:54

    I had this exact error .The problem was that 2 packages of matplotlib was installed one by conda and one by pip

    To test for this:

    $ conda list matplotlib

    matplotlib 2.0.2 np113py35_0 matplotlib 2.1.1

    Problem! Fix:

    $ pip uninstall matplotlib

    Probably a good idea to force matplotlib upgrade to the version pip wanted:

    $ conda install matplotlib=2.1.1

    0 讨论(0)
  • 2020-12-17 18:59

    I had exactly the same error after installing scikit. The workaround for that was to upgrade pip using the following command first before installing any other packages.

    !pip install pip --upgrade
    
    0 讨论(0)
提交回复
热议问题