December 24th, 2012, 05:32 AM
How to use python3 insted of python2.6 in centos
I have centos 6.3 os.
python2.6 install allready.
i have install python3.0
if i installed any software it by defult used python2.6 as python.
but i want to use python3.0 as defulte python .
so how to do this. please give me some replay.
as possible as fast
December 24th, 2012, 06:06 AM
It’s not really recommended to change the distribution’s default version of Python because it might break system scripts. Typically you just add “#!/usr/bin/env python3” at the top of all those scripts that actually need Python 3.
Originally Posted by naitik
However, “/usr/bin/python” is a symlink to the actual Python executable in all distributions I know, so changing that will change the default Python, as in (NB. mutatis mutandis):
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
My armada: Debian GNU/Linux 8 (desktop, home laptop, work laptop), Raspbian GNU/Linux 8 (nameserver), Ubuntu 14.04.3 LTS (HTPC), PC-BSD 10.2 (testbed), Android 4.2.1 (tablet)