Tried to make python3 by default in ubuntu, executed the command: sudo ln -sf python3 /usr/bin/python . Forgetting that many most programs are written in python2.7. Tried to do: sudo ln -sf python2.7 /usr/bin/python , something worked, but something didn't. For example, modules installed through pip work terribly

  • What does "work awfully" mean? - pank
  • one
    Do not replace python with python3. Many system parts and utilities use python2 and in the case of a replacement interpreter will crash with errors. - m9_psy

2 answers 2

To select the correct version of the interpreter, the correct solution would be to specify it in the first line of the .py file:

 #/usr/bin/env python3 

    Run: sudo ln -sf python3 /usr/bin/python everything worked for me after that.

    • minus. Do not touch the system python on ubunt - this is a good way to render it inoperative. You can create for yourself (for example, in ~/bin/ ) a python link that points to the desired version, but /usr/bin/python should not be touched (what apt put there, it should be). - jfs