windows下安裝Python2和Python3共存

1、Python安裝

1.下載安裝包

    

1 https://www.python.org/ftp/python/2.7.14/python-2.7.14.amd64.msi    # 2.7安裝包
2  
3 https://www.python.org/ftp/python/3.6.4/python-3.6.4-amd64.exe      # 3.6安裝包

2.安裝Python3.6

3.在命令行下測試

4. 安裝python2.7

5. 將python2增長到環境變量裏

1 C:\Python27\Scripts\;C:\Python27\;

6. 將C:\Python27目錄下的python.exe 和pythonw.exe 改成python2.exe 和pythonw2.exe 

7. 將C:\Python36目錄下的python.exe 和pythonw.exe 改成python3.exe 和pythonw3.exe 

8. 此時在命令行輸入python3表明python3  輸入python2表明python2

2、pip的安裝

 

1 #在cmd上執行 
2 python3 -m pip install --upgrade pip --force-reinstall
3 python2 -m pip install --upgrade pip --force-reinstall
4  
5  
6 #查看pip版本
7  
8 pip3 -V
9 pip2 -V

相關文章
相關標籤/搜索