windows下安装Python2和Python3共存
windows下安装Python2和Python3共存
一、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
二、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