切换视频源:

Matplotlib 安装

作者: 莫烦 编辑: 莫烦 2016-11-03

学习资料:

对于 Linux, MacOS, Windows 的安装方式各不相同.

Linux

打开 Terminal 窗口, 输入以下内容

# python 3+ 请复制以下在 terminal 中执行
$ sudo apt-get install python3-matplotlib

# python 2+ 请复制以下在 terminal 中执行
$ sudo apt-get install python-matplotlib

MacOS

打开 Terminal 窗口, 输入以下内容

# python 3+ 请复制以下在 terminal 中执行
$ pip3 install matplotlib

# python 2+ 请复制以下在 terminal 中执行
$ pip install matplotlib

Windows

Windows 的安装最麻烦. 我们一步步来:

Matplotlib 安装

    matplotlib-1.5.3-cp35-cp35m-win32.whl (md5)
    1.5.3 : plt版本
    cp35  : python 版本
    win32 : Windows 32位系统
    whl   : wheel 文件 
  • 用 CMD 找到这个 .whl 文件目录, 然后 pip 安装. 以 matplotlib-1.4.3-cp35-none-win32.whl文件为例:
$ cd python_work   # 用 cd 去到你下载的文件目录

# 如果是 python 3+ 版本, 像下面一样
python_work$ python -m pip3 install matplotlib-1.4.3-cp35-none-win32.whl
  • 如果安装不成功, 还有一种方法可以简便安装所有科学运算模块. 可以搜索一下 Anaconda python

分享到: Facebook 微博 微信 Twitter
如果你觉得这篇文章或视频对你的学习很有帮助, 请你也分享它, 让它能再次帮助到更多的需要学习的人. 莫烦没有正式的经济来源, 如果你也想支持 莫烦Python 并看到更好的教学内容, 赞助他一点点, 作为鼓励他继续开源的动力.

支持 让教学变得更优秀