Python automatically installs PIP

  • 2020-04-02 13:36:44
  • OfStack

If the Windows installation is complete, you need to add '\Python27\Scripts\' to the system environment variable


# 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'


Related articles: