1、安裝Python的多個版本
例如挽鞠,我在Window中安裝了python2.7-64、python2.7-32和python3.7三個版本信认。
2狮杨、環(huán)境變量配置:
在環(huán)境變量的Path中添加python和pip的啟動路徑
D:\Software\Python27\ --安裝python2.7-64啟動路徑到忽;
D:\Software\Python27\Scripts --安裝python2.7-64時候pip等相關(guān)啟動路徑喘漏;
D:\Software\Python27_x86\ --安裝python2.7-32啟動路徑;
D:\Software\Python27_x86\Scripts --安裝python2.7-32時候pip等相關(guān)啟動路徑持灰;
D:\Software\Python37\ --安裝python3.7啟動路徑负饲;
D:\Software\Python37\Scripts --安裝python3.7時候pip等相關(guān)啟動路徑;
3妥泉、Python多版本啟動和pip install
方法1:修改啟動文件(不推薦盲链,需要修改啟動文件)
將D:\Software\Python27\python.exe拷貝一份迟杂,重命名為python2.exe
#python2.7-64
python2
python2 -m pip install xxxxxx
將D:\Software\Python27_x86\python.exe拷貝一份,重命名為python2_x86.exe
#python2.7-32
python2_x86
python2_x86 -m pip install xxxxxx
將D:\Software\Python37\python.exe拷貝一份侧漓,重命名為python3.exe
#python3.7
python3
python3 -m pip install xxxxxx
方法2:py.exe參數(shù)識別(推薦火架,不需要任何修改)
#python2.7-64
py -2
py -2 -m pip install xxxxxx
#python3.7
py -3
py -3 -m pip install xxxxxx