我使用的是哪个版本的python?

时间:2018-04-03 23:07:15

标签: python-2.7 ubuntu

Ubuntu向我展示了两个不同版本的python。我打电话给我用的是什么?

$ python --version
  2.7.6
$ python2.7 --version
  2.7.14

我从tarball安装了2.7.14。它是我想要使用的版本,并希望python命令引用它。我怎么能这样做?

 $ whereis python

python: /usr/src/Python-2.7.14/python /usr/bin/python2.7 /usr/bin/python /usr/bin/python3.5-config /usr/bin/python3.6m /usr/bin/python3.4-config /usr/bin/python3.6 /usr/bin/python3.4m /usr/bin/python3.5m-config /usr/bin/python3.5m /usr/bin/python3.5 /usr/bin/python3.4 /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/bin/python3.4m-config /etc/python2.7 /etc/python /etc/python3.6 /etc/python3.5 /etc/python3.4 /usr/lib/python2.7 /usr/lib/python3.6 /usr/lib/python3.5 /usr/lib/python3.4 /usr/bin/X11/python2.7 /usr/bin/X11/python /usr/bin/X11/python3.5-config /usr/bin/X11/python3.6m /usr/bin/X11/python3.4-config /usr/bin/X11/python3.6 /usr/bin/X11/python3.4m /usr/bin/X11/python3.5m-config /usr/bin/X11/python3.5m /usr/bin/X11/python3.5 /usr/bin/X11/python3.4 /usr/bin/X11/python3.6-config /usr/bin/X11/python3.6m-config /usr/bin/X11/python3.4m-config /usr/local/bin/python2.7 /usr/local/bin/python2.7-config /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python3.5 /usr/local/lib/python3.4 /usr/include/python3.6m /usr/include/python3.6 /usr/include/python3.4m /usr/include/python3.5m /usr/include/python3.5 /usr/include/python3.4 /usr/share/python /usr/share/man/man1/python.1.gz


$ which python
 /usr/bin/python
$ which python2.7
 /usr/local/bin/python2.7

0 个答案:

没有答案