python自動安裝pip
來源:懂視網
責編:小采
時間:2020-11-27 14:30:18
python自動安裝pip
python自動安裝pip:如果是windows安裝完成后,需要將'\Python27\Scripts\'加入系統環境變量 代碼如下:# coding=utf-8import osimport urllib2url='https://raw.github.com/pypa/pip/master/contrib/get-pip.py'print 'load beg
導讀python自動安裝pip:如果是windows安裝完成后,需要將'\Python27\Scripts\'加入系統環境變量 代碼如下:# coding=utf-8import osimport urllib2url='https://raw.github.com/pypa/pip/master/contrib/get-pip.py'print 'load beg

如果是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'
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
python自動安裝pip
python自動安裝pip:如果是windows安裝完成后,需要將'\Python27\Scripts\'加入系統環境變量 代碼如下:# coding=utf-8import osimport urllib2url='https://raw.github.com/pypa/pip/master/contrib/get-pip.py'print 'load beg