我已经安装了python3.6.5,但是当我输入Python时,它显示python2.7.5。 我喜欢使用python3。在
[aravind@aravind05 Python-3.6.5]$ python3 --version
Python 3.6.5
[aravind@aravind05 Python-3.6.5]$ python
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
我想用python3
正如Klaus在评论中所说,更改系统Python版本可能会破坏系统。在
相反,使用virtualenv。Here是一个很好的解释,如果你需要帮助的话。在
因为您的系统中都安装了Python的两个版本,所以您需要将默认的Python指向python3.x。在
下面是相关的问题:https://stackoverflow.com/a/41986843/4982185
有多种方法可以实现这一点。在
假设您在一些*NIX操作系统上使用类似bourneshell的shell,那么可以定义一个别名
alias python python3
。在您还可以将一个名为“python”的符号链接放在前面路径中列出的目录中:
相关问题 更多 >
编程相关推荐