码迷,mamicode.com
首页 > 编程语言 > 详细

python安装matplotlib:python -m pip install matplotlib报错

时间:2019-12-04 23:35:56      阅读:379      评论:0      收藏:0      [点我收藏+]

标签:error   sel   code   app   pool   alt   cmd   efault   ams   

  • matplotlib是python中强大的画图模块。
  • 首先确保已经安装python,然后用pip来安装matplotlib模块。
  1. 进入到cmd窗口下,建议执行python -m pip install -U pip setuptools进行升级。
  2. 接着键入python -m pip install matplotlib进行自动的安装,系统会自动下载安装包。
  3. 安装完成后,可以用python -m pip list查看本机的安装的所有模块,确保matplotlib已经安装成功。
  • 技术图片

如果你能看的上面的matplotlib(2.0.0)证明你安装成功

如果你像我一样报错了:


 

  1. Downloading https://files.pythonhosted.org/packages/dd/73/dc25ca27a9960539ef98

4921b0d42368445b856ae0861c3acba542b9a39c/matplotlib-3.1.2-cp37-cp37m-win_amd64.w
hl (9.1MB)
| | 20kB 144bytes/s eta 17:24:10ERROR: Excep
tion:
Traceback (most recent call last):
File "C:\Users\wzc3\AppData\Local\Programs\Python\Python37\lib\site-packages\p
ip\_vendor\urllib3\response.py", line 425, in _error_catcher
yield


 

别慌,我来帮你分析下:

  1.  首先,如果你能看的这个:| | 20kB 144bytes/s eta 17:24:10;证明,你已经下载了一部分
  2. 其次,看报错的结尾,如果你能看的这个:

    raise ReadTimeoutError(self._pool, None, "Read timed out.")
    pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files
    .pythonhosted.org‘, port=443): Read timed out. 
    证明,是下载超时

  3. 最后,怎么解决超时呢?,修改下你的安装命令像这样,就可以了:

    python -m pip install matplotlib --default-timeout=10000
    祝你好运~~

python安装matplotlib:python -m pip install matplotlib报错

标签:error   sel   code   app   pool   alt   cmd   efault   ams   

原文地址:https://www.cnblogs.com/focusta/p/11986375.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!