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

前端 未结 3 2011
逝去的感伤
逝去的感伤 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: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

提交回复
热议问题