最新版本的matplotlib和numpy居然不兼容!!!

报错1:numpy.ufunc size changed, may indicate binary incompatibility
报错2:RuntimeError: implement_array_function method already has a docstring
这些情况都是因为matplotlib和numpy的版本不兼容

已知的兼容版本:
    python3.6;
    numpy1.16.3或者1.18.2;
    pandas0.24.2;
    matplotlib3.0.3

首先,卸载掉以前的numpy版本,安装1.18.2版本

pip install https://pypi.tuna.tsinghua.edu.cn/simple numpy==1.18.2

然后,从这个网站https://pypi.org/project/matplotlib/3.0.3/#files选择适合自己版本的matplotlib。
我选择的是matplotlib-3.0.3-cp37-cp37m-win_amd64.whl。
command+R,CMD,打开whl所在的文件夹之后进行安装。
这里安装过程中还要安装其他依赖包,为了防止超时,设置–default-timeout=100。

d:
cd Downloads
pip --default-timeout=100 install matplotlib-3.0.3-cp37-cp37m-win_amd64.whl

终于弄好了,嘿嘿嘿嘿。

参考文献
https://blog.csdn.net/the_harder_to_love/article/details/90612091
https://www.cnblogs.com/LCcnblogs/p/6230681.html

你可能感兴趣的:(计算机基础,python基础)