windows命令行切换python版本

安装2.x 和 3.x 的python

我这里使用anaconda来安装两个版本的python包。

conda create --name python2 python=2.7
conda create --name python23 python=2.7

安装完之后,在你的anaconda程序目录下会发现:


设置系统环境变量


pip的使用

安装的时候,最好加上清华源,不然可以因为网络问题报错。

python2 -m pip install termcolor -i https://pypi.tuna.tsinghua.edu.cn/simple
python3 -m pip install termcolor -i https://pypi.tuna.tsinghua.edu.cn/simple

python2 -m pip list
python3 -m pip list

参考

https://blog.csdn.net/fxjzzyo/article/details/77070868

原文地址:https://www.cnblogs.com/mysticbinary/p/12822055.html