本文介绍:利用 python numpy +matplotlib.finance 依赖安装
matplotlib.finance可以很方便的绘制股票图表,但是
matplotlib2以上版本已经把mpl_finance模块移除了,所以需要先安装才能使用.
直接导入import mpl_finance as mpf会提示错误:
No Module named finance
第一步 : 安装mpl_finance
github下载模块文件: https://github.com/matplotlib/mpl_finance.
下载到本地,解压后,打开终端,进入解压目录mpl_finance-master(路径不一样):
cd /Users/niexiaobo/Downloads/mpl_finance-master
管理员权限安装,回车输入电脑密码开始安装:
sudo python setup.py install
安装成功:
...
Adding setuptools 39.1.0 to easy-install.pth file
Installing easy_install script to /anaconda3/bin
Using /anaconda3/lib/python3.6/site-packages
Finished processing dependencies for mpl-finance==0.10.0
注意普通安装可能提示么有权限:
...
Processing mpl_finance-0.10.0-py3.6.egg
Copying mpl_finance-0.10.0-py3.6.egg to /anaconda3/lib/python3.6/site-packages
Adding mpl-finance 0.10.0 to easy-install.pth file
error: [Errno 13] Permission denied: '/anaconda3/lib/python3.6/site-packages/easy-install.pth'
网友评论