windows下安装Python2和Python3共存

一、Python安装

1.下载安装包

    

 https://www.python.org/ftp/python/2.7.14/python-2.7.14.amd64.msi    # 2.7安装包

 https://www.python.org/ftp/python/3.6.4/python-3.6.4-amd64.exe      # 3.6安装包

2.安装Python3.6

windows下安装Python2和Python3共存

windows下安装Python2和Python3共存

3.在命令行下测试

windows下安装Python2和Python3共存

4. 安装python2.7

windows下安装Python2和Python3共存

windows下安装Python2和Python3共存

windows下安装Python2和Python3共存

5. 将python2增加到环境变量里

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

6. 将C:\Python27目录下的python.exe 和pythonw.exe 改为python2.exe 和pythonw2.exe

windows下安装Python2和Python3共存

7. 将C:\Python36目录下的python.exe 和pythonw.exe 改为python3.exe 和pythonw3.exe

windows下安装Python2和Python3共存

8. 此时在命令行输入python3代表python3  输入python2代表python2

windows下安装Python2和Python3共存

二、pip的安装

 #在cmd上执行
 python3 -m pip install --upgrade pip --force-reinstall
 python2 -m pip install --upgrade pip --force-reinstall

 #查看pip版本

 pip3 -V
 pip2 -V

windows下安装Python2和Python3共存

上一篇:【Java】关于并发


下一篇:自动化工具之三:pywinauto