Find the answer to your Linux question:
Results 1 to 4 of 4
Hello everyone, Python 2.5.2 is shipped with my version of Debian (Lenny), but I have installed Python 2.6.2 from source and it works. Python 2.5 is located at its usual ...
  1. #1
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474

    Setting default Python version

    Hello everyone,

    Python 2.5.2 is shipped with my version of Debian (Lenny), but I have installed Python 2.6.2 from source and it works. Python 2.5 is located at its usual /usr/bin/python and 2.6 at /usr/local/bin/python.

    I want to set the latter as my default version when I type "python" in my terminal. How can I do that.

    Thanks a lot!

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Check for symlinks
    # ls -l /usr/bin/ | grep python*
    all versions executables are named as python2.4, python 2.6, python3.0 and so on.
    and "python" is directed to any one of this. using symlink.
    Just rename old symlink then.
    # ln -s /usr/local/bin/python /usr/bin/python
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    another way is to add into PATH env variable the new Python bin path before your /usr/local/bin or /usr/bin

  4. #4
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474
    Thank you b2bwild and ghostdog74.

    I was aware of the symlink, but am concerned that if I install something via the repositories that requires and uses Python that it might malfunction if the version executed during the installation/running of a certain application differs from 2.5.2...?

    I could probably just set it back but am not sure where 2.5.2 is located exactly if /usr/bin/python is a symlink.. What (where) is it linked to.

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...