1.针对linux版本
linux版本的话,首先调用whereis python 来获取到多版本的路劲。
root@Ulord-14:~# whereis python python: /usr/bin/python3.5m /usr/bin/python2.7-config /usr/bin/python /usr/bin/python3.5m-config /usr/bin/python2.7 /usr/bin/python3.5 /usr/bin/python3.5-config /usr/lib/python2.7 /usr/lib/python3.5 /etc/python /etc/python2.7 /etc/python3.5 /usr/local/lib/python2.7 /usr/local/lib/python3.5 /usr/include/python3.5m /usr/include/python2.7 /usr/include/python3.5 /usr/share/python /usr/share/man/man1/python.1.gz
这样你就会发现不同的版本的所在路径,默认只是python时是python2.7版本

然后删除这个/usr/bin/python 在调用软连接把python2 和 python3 改下名字即可。
rm -rf /usr/bin/python ln -s /usr/bin/python3.5 /usr/bin/python3 ln -s /usr/bin/python2.7 /usr/bin/python2


2.windos版本
windows桌面系统上可以同时存在anaconda python2.7 python3 和linux不同,这个首先需要你把各个版本的python环境变量先添加到windows中,然后回到对应的路径,复制一份对应的python可执行文件后,改成你想要的名字即可,重启cmd后即可生效。
网友评论