Python2和Python3共存

方法一:

找到python2.7安装目录D:\Python27将python.exe改为 python2.exe这样就可以使用python2

找到Python3 的安装目录D:\Python36将python.exe改为python3.exe

使用

1
python2.exe -V

1
python3.exe -V

方法二:

官方的方法,推荐此方法。

python 的使用
1
py -2 -V

这样使用2.x的版本

1
py -3 -V

这样使用3.x的版本

pip的使用

使用Python2 的pip:

1
pip2 -V

或者

1
py -2 -m pip -V

使用Python3 的pip:

1
pip3 -V

或者

1
py -3 -m pip -V