pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

起因:安装matplotlib

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

 

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

安装后提示出现错误:

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

查看Pycharm下载页,对应的是matplotlib版本是3.1.1

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

(查看一下3.1.1是不是不支持python3.8)

进入https://matplotlib.org/

查看说明。里面明确说了 3.1.1是稳定版本。3.2.x不稳定

pycharm2019.2(python3.8)安装matplotlib失败的解决方法pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

进入到下载页面https://pypi.org/project/matplotlib/#files

 

发现:稳定版本的3.1.1不支持cp38(即python3.8)

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

所以安装才会失败。出现错误提示。

 

解决方法:

  1. 将python由python3.8版本降到python3.7/3.6
  2. 找新版本

使用不稳定的高版本3.2.0。

https://pypi.org/project/matplotlib/3.2.0rc1/#files

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

下载对应的版本:这里选择的如上图圈所示。本人安装的python3.8是64bit位的。

将下载的whl文件放到Python\Scripts的文件夹里。实际上放到哪里都可以。关键是你要能通过win->cmd->找到它。

(这里当时在CSDN看到了这位大神写的解决方法:

https://blog.csdn.net/qq_41363459/article/details/102941688。所以依葫芦画瓢也放在python\Scripts文件夹里面)

我的python安装位置在D:\Program Files里面

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

然后运行*.whl安装包:

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

等待2-5分钟

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

提示安装Successfully

最后验证是否安装成功:

打开终端:win->cmd

pycharm2019.2(python3.8)安装matplotlib失败的解决方法

 

输入: python

进入python界面

(终端显示python界面就是 >>> )

输入:import matplotlib

没有任何提示,表示已安装成功。

pycharm2019.2(python3.8)安装matplotlib失败的解决方法