Find the answer to your Linux question:
Results 1 to 5 of 5
Hi! Hi I got python 2.6.2 installed by default in my system and I was able to install the 3.2 version successfully. I thought that the newer version would automatically ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272

    Python 2.6.2 & 3.2 Both Installed :confused:


    Hi!

    Hi I got python 2.6.2 installed by default in my system and I was able to install the 3.2 version successfully. I thought that the newer version would automatically be used but when I invoke python, the older one still exist.

    I was wondering if I there is a way I can delete the old and use the new. And would it affect my system too. Any words of wisdom is appreciated. Thank you!

    Code:
    jun@jun-laptop:~$ uname -a
    Linux jun-laptop 2.6.28-19-generic #66-Ubuntu SMP Sat Oct 16 17:39:04 UTC 2010 i686 GNU/Linux
    
    jun@jun-laptop:~$ python --version
    Python 2.6.2
    
    jun@jun-laptop:~$ python3.2
    Python 3.2 (r32:88445, May  9 2011, 14:08:12) 
    [GCC 4.3.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    nujinini
    Linux User #489667

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757
    The problem , I assume , python old version might be tried to some system scripts/application.

    Anyway if you want to try - I would suggest following method.
    find out python binaries/libraries using
    $whereis python
    command
    and then rename them instead of deleting it -

    mv /usr/lib/python2.6 /usr/lib/python2.6_old
    So that If something goes wrong,you can revert back to original status. (by using live-cd or something)
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,283
    Hi.

    Observations:

    1) It looks like you are using Ubuntu, a derivative of Debian,

    2) In distributions that have package managers, the safest course is to use the package managers -- installing without informing the package manager can lead to difficulty later on,

    3) In the version of Ubuntu I currently use, there are at least two versions of python available:
    Code:
    Distribution        : Ubuntu 10.04.2 LTS (lucid)
    python2.6 - An interactive high-level object-oriented language (version 2.6)
    python3.1 - An interactive high-level object-oriented language (version 3.1)
    There is a system for dealing with alternate versions:
    Code:
          update-alternatives creates, removes, maintains and  displays  informa-
           tion  about  the symbolic links comprising the Debian alternatives sys-
           tem.
    
    -- excerpt from man update-alternatives
    However, I don't know if the alternatives management would work with packages installed outside the knowledge of the package manager.

    4) One question that would be important to me: am I sure that all current system processes that use the default python will work correctly if the default is changed from 2.x to 3.y?

    Good luck ... cheers, drl
    Last edited by drl; 05-09-2011 at 10:47 AM.
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  4. #4
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Those two versions of python exist because the upgrade pf python 2.X => 3.X breaks things.

    If one looks at python 2.7 as the last stable release and 3.2 as the current bleeding edge, it lays at hands that "they" most probably decided to point python to 2.X if 2.X is installed and install python 3.X named as such. This way existing applications written for 2.X won't break unless one uninstalls python 2.X, in which case the only python remaining would point to 3.X.

    The existance of 3.X can further be explained as a developers playground/sandbox for:
    * migration of their 2.X applications to 3.X over the next few years
    * test 3.X to find and fix bugs
    * ... etc
    which also explains why most production environments rely on python 2.X (i.e. google appengine: 2.5.2).

  5. #5
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272

    Red face Rather No Fix What Isn't Broken

    Thank you for all your replies.

    I guess I'd be contented using the older version since I don't want to risk screwing my system. I'm afraid that other applications might not run properly with python 3x.


    Cheers!
    nujinini
    Linux User #489667

Posting Permissions

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