python2.7.6离线安装Matplotlib

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/listener51/article/details/79016468


1、离线安装pip

(1)在python的安装目录下,新建packages文件夹,例:C:\Python27\packages

(2)https://pip.pypa.io/en/stable/installing/   下载get-pip.py

(3)Unofficial Windows Binaries for Python Extension Packages 下载pip-8.1.2-py2.py3-none-any.whlwheel-0.29.0-py2.py3-none-any.whl

ptyhon get-pip.py --no-setuptools --find-links=.\packages

get-pip.py options 

–no-setuptools 

If set, don’t attempt to install setuptools 

–no-wheel 

If set, don’t attempt to install wheel


2、查看pip 支持的whl类型

import pip; print(pip.pep425tags.get_supported())



3、安装Matplotlib

(1)需要提前安装:https://pypi.python.org/pypi/six  

(2)需要提前安装:https://pypi.python.org/pypi/numpy

matplotlib的各种依赖库在:https://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载,注意:下载的whl类型要和【2、查看Pip支持的whl类型】一致,否则会出现:

Installing numpy from wheel format: “…is not a supported wheel on this platform”


4、验证是否安装成功

# plot a sine wave from 0 to 4pi
from pylab import *
x_values = arange(0.0, math.pi * 4, 0.01)
y_values = sin(x_values)
plot(x_values, y_values, linewidth=1.0)
xlabel('x')
ylabel('sin(x)')
title('Simple plot')
grid(True)
savefig("sin.png")
show()


参考网址:http://www.voidcn.com/article/p-djcdtooa-rd.html

参考网址:https://www.lfd.uci.edu/~gohlke/pythonlibs/

参考网址:https://segmentfault.com/a/1190000006027207

参考网址:http://blog.csdn.net/sinat_26933727/article/details/68953193


猜你喜欢

转载自blog.csdn.net/listener51/article/details/79016468