windows下安装easy_install, pip 及whl文件安装方法

写在前面的话

最近在看”Computer Vision with Python”需要安装PIL库,平时一直在windows下开发,就去”Python Extensions for Windows”下找找看,结果下下来文件的拓展名是.whl。Google了一番才知道安装这种拓展名的包需要pip。平时习惯用.exe安装包,easy_install、pip都没装。扒拉点资料,整理下easy_install的安装方法。有一键安装脚本!

安装easy_install

  1. 下载ez_setup.py
from urllib import urlopen
data = urlopen('http://peak.telecommunity.com/dist/ez_setup.py')
with open('ez_setup.py', 'wb') as f:
    f.write(data.read())
  1. 在命令行中运行ez.setup.py
    《windows下安装easy_install, pip 及whl文件安装方法》

  2. 一键脚本
import os
file_name = 'ez_setup.py'
from urllib import urlopen
data = urlopen('http://peak.telecommunity.com/dist/ez_setup.py')
with open(file_name, 'wb') as f:
    f.write(data.read())
os.system('python %s' % (os.path.join(os.getcwd(),file_name)))

安装pip

easy_install pip

《windows下安装easy_install, pip 及whl文件安装方法》

安装whl文件

pip install whatever.whl

《windows下安装easy_install, pip 及whl文件安装方法》

    原文作者:翻墙搞科研
    原文地址: http://www.cnblogs.com/wu-wenmin/p/4250330.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞