【python】matplotlib在windows10 和win7下安装

win7系统升级win10后重装matplotlib
file resources

win10 64位操作系统 

1)Python2.7 64位         环境变量path python安装路径
2)pip-8.1.1  (source)   命令:python setup.py install 
环境变量path D:\sftwre_path\python27\Scripts
3)安装完pip后所有的wheel文件都用这个命令安装,图上所需的wheel文件都可以从链接4找到,顺序可以numpy,dateutil,pyparsing,six,scipy,最后matplotlib
命令:
pip install wheel
pip install *.wheel
4)用代码测试

这是之前win7 64位安装查找的资料(转载)
链接1 http://blog.sciencenet.cn/blog-579770-738240.html
链接2 http://www.open-open.com/lib/view/open1393488232380.html
链接3 http://blog.csdn.net/yang6464158/article/details/18546871#comments
链接4 http://www.lfd.uci.edu/~gohlke/pythonlibs/
链接123是靠谱的安装过程;此过程中需要的各种程序包都能在链接4(非官方下载,比较全)里找到。

注意:各个安装程序的版本必须一致,这里都统一用windows,64 bit,python2.7版本(据说Python3.*系列对于一些安装包不兼容,故选取了比较旧的python2.7版本)!!!!

1、python下载地址https://www.python.org/download/

2、安装与python相对应版本的Matplotlib,下载地址http://matplotlib.org/downloads.html

3、对于标准版本的Python,要使用Matplotlib,需要安装numpy模块,下载地址见链接4

4、可能还会用到msvcp.dll库,自行在网上搜一个添加到C:windowssystem32目录下。
此时如果运行 import matplotlib.pyplot as plt 可能会显示以下错误:
raise ImportError("matplotlib requiresdateutil")
ImportError: matplotlib requires dateutil
意味着需要dateutil

5、安装dateutil,下载地址http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil
此后又出现错误:
raise ImportError("matplotlib requirespyparsing")
ImportError: matplotlib requires pyparsing
意味着需要pyparsing

6、安装pyparsing,下载地址http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing
安装完又出现错误:
No module name six
需要安装scipy

7、安装scipy,下载地址见链接4。
然后把C:Python27Libsite-packagesscipylib中的six.py six.pyc six.pyo三个文件拷贝到C:Python27Libsite-packages目录下。
再在IDLE(Python GUI)中输入import matplotlib.pyplot as plt便可以解决啦!

8、输入以下代码不报错:
import matplotlib
import numpy
import scipy
import pyparsing
import matplotlib.pyplot as plt

9、验证一个简单的例子
import matplotlib.pyplot as plt
plt,plot([1,2,3])
plt.ylabel('some numbers')
plt.show()

10、其他有用的链接:
example: http://matplotlib.org/examples/index.html
gallery:http://matplotlib.org/gallery.html
http://blog.csdn.net/pzy20062141/article/details/48730985
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值