Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Specifically python:

$ which python

$ ll `which python`
lrwxrwxrwx 1 root root 9 Jun 18 10:26 /usr/bin/python -> python2.7

$ python
The program 'python3' is currently not installed.

$ ll /usr/local/bin/python
ls: cannot access /usr/local/bin/python: No such file or directory

$ whereis python
python: /usr/bin/python /usr/bin/python2.7 /etc/python /etc/python2.7 /usr/lib/python2.7 /usr/bin/X11/python /usr/bin/X11/python2.7 /usr/local/lib/python2.7 /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz

$ python2.7 
Python 2.7.3 (default, Sep 26 2013, 20:03:06) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

I don't understand why python won't run python2.7 here -- isn't the symlink pointing to python2.7?

share|improve this question
Do you have a /usr/local/bin/python that is a symlink to python3 perhaps? – dobey Nov 7 '13 at 0:37
@dobey seems like no, updated the post – jcollum Nov 7 '13 at 0:39
What is the output of whereis python and echo $PATH commands? – Radu Rădeanu Nov 7 '13 at 0:40
@RaduRădeanu echo $PATH has a lot of stuff, anything in particular? grepping for python didn't yield anything, if that helps – jcollum Nov 7 '13 at 0:42
Yes, the order of directories from the PATH and the output of type python? – Radu Rădeanu Nov 7 '13 at 0:44
up vote 3 down vote accepted

You might have an alias. Try type -a python

share|improve this answer
Nicely done: python is aliased to ``python3' – jcollum Nov 7 '13 at 0:44
so which doesn't go through aliases? – jcollum Nov 7 '13 at 1:20
clearly not. man which – glenn jackman Nov 7 '13 at 1:23
That's clear? If you say so man. – jcollum Nov 7 '13 at 1:28
you don't have to believe me. look at your own terminal. – glenn jackman Nov 7 '13 at 2:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.