#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    How to use python3 insted of python2.6 in centos


    Hi,
    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Location
    Joensuu, Finland
    Posts
    430
    Rep Power
    67
    Originally Posted by naitik
    if i installed any software it by defult used python2.6 as python.
    but i want to use python3.0 as defulte python .
    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.

    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):

    Code:
    sudo rm /usr/bin/python
    sudo ln -s /usr/bin/python3 /usr/bin/python
    My armada: openSUSE 13.1 (home desktop, home laptop), Crunchbang Linux 11 (mini laptop, work laptop), Android 4.2.1 (tablet)

IMN logo majestic logo threadwatch logo seochat tools logo