python3和python2共存
2019-01-31 本文已影响0人
喔平凡心
第一步
先去python官网下载python2和python3的安装包并将他们安装
第二步
去我的电脑-属性-高级系统设置-环境变量-系统变量里的path添加python的安装路径




第三步
将python2和python3安装路径里的python.exe改成python2或python3.exe


第四步
在cmd里测试运行python2 python3

如未成功请再次检查哪一步安装错误
第五步
重新安装pip,不然pip只是python2或python3的一个
在cmd里输入如下命令
python3 -m pip install --upgrade pip --force-reinstall
python2 -m pip install --upgrade pip --force-reinstall

然后输入
pip2 -V
pip3 -V
进行测试

然后就完成了
最后说一下如何在pycharm里添加
在pycharm-setting-project里添加python安装路径



