如何更改我的PYTHONPATH使3,2是我的默认Python而不是2.7.2?

Modified on: Sat, 09 Jun 2018 11:26:23 +0800

我的python3.2位于/usr/lib/python3.2中。我不确定这是否意味着它已安装,但我认为现在是这样。

关于我的系统的一些事实:

$ which python
/usr/local/bin/python

当我在终端输入python时,我得到以下内容

$ python
Python 2.7.2 (default, Dec 19 2011, 11:12:13) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

然后找到我做的路径

>>> sys.info >>> sys.path ['', '/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/usr/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg', '/usr/local/lib/python2.7/site-packages/PIL-1.1.7-py2.7-linux-x86_64.egg', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']

所以知道这一切,我如何将默认系统python从2.7.2更改为3.2?

作者:max

最佳答案

更改默认python并不好。许多系统程序依赖于python2而不是python3。如果你想使用python3,你只需输入命令python3

作者:liuerfire

相关问答

添加新评论