发布于 2014-10-10 10:16:25 | 241 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

pip Python包安装和管理工具

pip 是一种安装和管理 Python 包的工具。


本文为大家讲解了python自动安装pip的示例,需要的朋友可以参考下

如果是windows安装完成后,需要将'Python27Scripts'加入系统环境变量
 


# coding=utf-8
import os
import urllib2
url='https://raw.github.com/pypa/pip/master/contrib/get-pip.py'
print 'load begin,please waite'
response=urllib2.urlopen(url)
with open('./download.py','w') as f:
 f.write(response.read())
print 'load end'

 

import download
download.main()

print 'clear up'
filepath=['./download.py','./download.pyc']
try:
 for path in filepath:
  os.remove(path)
except :
 pass

print 'insall pip success,please add 'Python27Scripts' to u enveronment path'

 



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务