1

on Ubuntu 14.04 has python-3, python-2.7 and python is linked to python-2.7 by default. I have to run python-3 code on ubuntu -14.04. Can I modify /usr/bin/python link to python3? Any idea?

Thanks

mrudula
  • 477
  • 5
  • 9
  • 17

1 Answers1

7

Don't do that.

A lot of things will (probably) break if you change the default python interpreter to python3.

The switch is not a simple one --- although by 16.04 I think that all the system scripts will be python3, it will probably not switched even then (thanks @florian-deisch). Other distros, like Arch, did the switch, but I am not sure if this is a good thing, given that there is a PEP explicitly suggesting the contrary...

Simply use

#!/usr/bin/env python3

as the "shebang" line (first line) of the scripts that you want to be run by python3.

muru
  • 207,228
Rmano
  • 32,167