从matplotlib 2.2.0版本开始,matplotlib.finance已经从matplotlib中剥离了,需要单独安装mpl_finance这个包了。
API Changes in 2.2.0 The matplotlib.finance modules have been removed. matplotlib.finance remains available at https://github.com/matplotlib/mpl_finance.
安装方式有两种:
1 在anaconda环境中
将https://github.com/matplotlib/mpl_finance/archive/master.zip下载到本地
在anaconda 命令行中pip install 本地/master.zip
2 在非anaconda环境中
git clone git@github.com:matplotlib/mpl_finance.git
等待下载后,进入该目录, 命令行执行sudo python setup.py install
参考:
http://www.30daydo.com/article/296
http://tieba.baidu.com/p/5021381557