您的位置:首页 > 编程语言 > Python开发

window离线安装pip, wheel, numpy,matplotlib

2016-04-13 20:26 567 查看
由于电脑无法联网,只能离线安装, 电脑里只有python 2.7, 下面是安装步骤, 所有的安装包都可以在下面的官网网站下载:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

1. pip安装

下载对应版本的pip.whl后, 还要在该网站下载里面的get-pip.py:

https://pip.pypa.io/en/stable/installing/

该文件是在线下载安装, 而里面也介绍了安装本地pip副本的方法:

安装时的可选项:

get-pip.py options

–no-setuptools

If set, don’t attempt to install setuptools

–no-wheel

If set, don’t attempt to install wheel

Additionally, get-pip.py supports using the pip install options and the general options. Below are some examples:

Install from local copies of pip and setuptools:

python get-pip.py –no-index –find-links=/local/copies

上面的/local/copy是放pip安装文件的路径

由于我没有下载wheel 和setuptools, 所以这两个不安装, 将pip…whl和get-pip.py放到一个地方,我放在d:盘, 所以的cmd下运行下面的命令:

python get-up.py --no-setuptools --no-wheel --find-links=d:\


OK

2 . wheel安装

由于numpy.whl的安装需要wheel, 所以在前面的连接里下载wheel, 这次用pip命令安装:

pip install wheel-0.29......whl


3 . numpy.whl安装

运行

pip inistal "numpy-1.11.0+mkl-cp27-cp27m-win32.whl"


注意:这里如果出现错误”numpy-1.11.0+mkl-cp27-cp27-win-amd64.whl is not a supported wheel on this platform”,那是因为你安装的pip wheel是32位的,而numpy是64位, 所以将numpy安装包换成32位的即可

4. 安装matlablib

这个包依赖好几个包,看前面网站上下载点的介绍:

Matplotlib, a 2D plotting library.

Requires numpy, dateutil, pytz, pyparsing, cycler, setuptools, and optionally pillow, pycairo, tornado, wxpython, pyside, pyqt4, ghostscript, miktex, ffmpeg, mencoder, avconv, or imagemagick.

上面几个加粗的是必须安装的依赖包, 还有一个 six 包也必须要安装, 下载这几个包后, 依次用pip安装: pyparsing ; pytz; setuptools; six; cycler; pytz; python-deteutil; matplotlib;

OK
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python