Same question found here but without a valid solution. The problem is that typing python in the terminal produces:

The program 'python' can be found in the following packages:
 * python-minimal
 * python3
Try: sudo apt install <selected package>

In fact, $ which python returns nothing. Additional information:

~$ echo $PATH

By default python should point to python2.7 in /user/bin. If I type python2.7, python runs normally. How to restore the default behavior when typing python in the terminal?

EDIT: Potential source of the problem: I've recently installed python 3.4.6 (in /user/local/bin) using the following commands. Than I tried to reinstall python 3.4.6 since there was a problem with pip now fixed.

make test
sudo make install
  • The next question is then always: what did you do that might have caused this? – Jacob Vlijm Mar 8 '17 at 19:34
  • 1
    The answer is in the question: Reinstall python-minimal. – user535733 Mar 8 '17 at 19:36
  • I've edited the post. – MLguy Mar 8 '17 at 19:42
  • 1
    DO NOT change the system version of Python. You will break your system horribly. Change it back. If you must add a new version of python, then install it manually instead of using packages. – user535733 Mar 8 '17 at 19:49
  • I'm not capable to restore the previous situation. My impression is that pointing python (when typed in the terminal) to /usr/bin/python2.7 should do the trick, but I don't know how (maybe using export PATH?). – MLguy Mar 8 '17 at 20:22

I fixed the problem with

sudo apt install python-minimal

as suggested in the warning message. I have decided to install python-minimal rather than python3 since the latter was already working smoothly in the terminal.

| improve this answer | |
  • it seems python-minimal is python 2.7. However, I would like to install python 3.X – rishi jain Mar 1 at 2:32

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