网络编程
位置:首页>> 网络编程>> Python编程>> python自动安装pip

python自动安装pip

  发布时间:2021-04-06 09:30:00 

标签:python,pip

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


# 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 \'\Python27\Scripts\' to u enveronment path'

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com