Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: How do I install python 2.7 in lucid?

  1. #1
    Join Date
    Sep 2006
    Location
    I live in India
    Beans
    41
    Distro
    Ubuntu 10.04 Lucid Lynx

    How do I install python 2.7 in lucid?

    I am about to start writing code for a new software project. I want to use python 2.7. What is the recommended way to install python 2.7 on lucid? Do I just download the software from the Python website and install it or should I do some extra things on Lucid?

  2. #2
    Join Date
    Nov 2009
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How do I install python 2.7 in lucid?

    Go to

    http://www.python.org/

    Click on "Source Distribution" under "Quick Links (2.7)" on the left. Extract the Downloaded file into a new folder. In the README file read the Build instructions. It will probably soon be available in synaptic too.

  3. #3
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do I install python 2.7 in lucid?

    Quote Originally Posted by Yarui View Post
    It will probably soon be available in synaptic too.
    I don't know the exact plans for MAverick, but right now Python 2.7 is not in it, so it might not appear in the repos until at least Maverick+1.
    「明後日の夕方には帰ってるからね。」


  4. #4
    Join Date
    Nov 2008
    Location
    UCSD
    Beans
    5
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: How do I install python 2.7 in lucid?

    Download the source from here:
    http://python.org/ftp/python/2.7/Python-2.7.tgz

    Code:
    tar xzf Python-2.7.tgz
    cd Python-2.7
    ./configure
    make
    sudo make altinstall
    Note that it is make altinstall, not make install. The altinstall makes sure you don't clobber the OS installed version.

  5. #5
    Join Date
    May 2005
    Location
    Caracas, Venezuela
    Beans
    9

    Re: How do I install python 2.7 in lucid?

    It is needed that libsqlite3-dev package to be installed for python installer make the pysqlite2 module.

    Instead, the Python2.6 ubuntu packge install this module.

    So, it is not as easy as you want to make it see.

    I would be great if one could install a Python2.7 ubuntu package from 10.10

    I think it is possible. how could it be done?

  6. #6
    Join Date
    Aug 2010
    Beans
    12

    Re: How do I install python 2.7 in lucid?

    Quote Originally Posted by davidism View Post
    Note that it is make altinstall, not make install. The altinstall makes sure you don't clobber the OS installed version.
    What do you mean clobber? Not replacing Ubuntu's Python 2.6.5 with the latest 2.7?

    Why not, will things break? I thought Python 2.7 was supposed to be fully backwards compatible? Did anyone try this?

    If I don't replace it and do the altinstall as you suggest, will I have to type "python27" (or something) every time I want to use the latest Python version instead of the old one?

  7. #7
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do I install python 2.7 in lucid?

    Quote Originally Posted by tripzilch View Post
    What do you mean clobber? Not replacing Ubuntu's Python 2.6.5 with the latest 2.7?

    Why not, will things break? I thought Python 2.7 was supposed to be fully backwards compatible? Did anyone try this?
    It's not a matter of compatibility between versions. The package manager installs Python 2.6. If you replace it with 2.7 without telling it, it will be confused.
    「明後日の夕方には帰ってるからね。」


  8. #8
    Join Date
    Dec 2004
    Location
    Manchester
    Beans
    2,082
    Distro
    Ubuntu Studio 13.04 Raring Ringtail

    Re: How do I install python 2.7 in lucid?

    python 2.x programs are generally 1 way compatible with each other (a python program written for 2.0 should work on 2.7), apart from a few small changes ('with' became a keyword and can't be used as a variable name any more). but for things that interact more deeply like python modules, more changes are needed. so if you use any 3rd party python modules, you will need a newer version that is compatible with 2.7.

    most linux distros can manage multiple python versions. each is installed as python2.5, python2.6 and then a python symlink points to the default one. so check the install options to make sure it does not make 2.7 the default.

    you may also want to set the prefix to something like /opt/python2.7 when configuring, and run it from /opt/python2.7/bin/python

  9. #9
    Join Date
    Dec 2007
    Location
    Gauteng
    Beans
    74
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: How do I install python 2.7 in lucid?

    Quote Originally Posted by davidism View Post
    Download the source from here:
    http://python.org/ftp/python/2.7/Python-2.7.tgz

    Code:
    tar xzf Python-2.7.tgz
    cd Python-2.7
    ./configure
    make
    sudo make altinstall
    Note that it is make altinstall, not make install. The altinstall makes sure you don't clobber the OS installed version.
    Hi I did the altinstall but don't see any benefit because everything is still just running through python 2.6. Should I remove 2.6 in my Synaptic Package Manager?

    For interest how do I uninstall the python 2.7 to have my environment like it was before the altinstall?

    Thanks.

  10. #10
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: How do I install python 2.7 in lucid?

    Quote Originally Posted by mongoose_za View Post
    Hi I did the altinstall but don't see any benefit because everything is still just running through python 2.6. Should I remove 2.6 in my Synaptic Package Manager?
    Well, in general, there is no benefit in running a newer Python just because it is newer.

    Your Ubuntu 10.10 system is designed to use Python 2.6, so if you attempt to use an older or newer version, it will most probably cause you problems.

    The only valid reason to have multiple Python (Perl, Tcl, Bash, or other) interpreters is:
    1. if you really know what you are doing, and
    2. you know you need the features specific versions provide, for example, if you need to develop and support a legacy application.

    The original poster presumably had a valid reason to install Python 2.7, because he wanted to use newer features that are not available yet in the current version.

    You should not attempt to remove Python 2.6, because a lot of things in Ubuntu will break. Also, the Python installed from source, is not registered in the package manager. If you are successful in removing the old one, you will break lots of dependencies. Although it may be possible to force the newer installation, what will happen when you try to upgrade to the newest Ubuntu 11.04? How is the package manager supposed to know? It will reinstall Python 2.6 and then continue upgrading to the newer Python anyway. So in summary, it's a mess.

    What I'm trying to say is, you can force your way and install everything you like, but be conscious that versions, regular Ubuntu releases, package managers, etc. are there for a reason.

    For interest how do I uninstall the python 2.7 to have my environment like it was before the altinstall?

    Thanks.
    Python is notoriously difficult to remove from source.

    As in any program in Linux, you may just delete all the directories and files created by the installation, and that is equivalent to removing it.

    Your environment is not changed. As all programs by default use "/usr/bin/python", and this symlink points to "/usr/bin/python2.6", you should be fine.

    Actually, that you have to call "python2.7" manually is a good thing, because then you can choose to run your programs with a stable, distribution-provided Python 2.6, or your installed 2.7.

    Again, you can install everything you like, but if you don't understand very well what you are doing you should probably not attempt it in the first place.

    My experience with this is that I actually helped someone who had this exact problem, a few weeks ago, on the IRC channel #ubuntu. He installed 2.7 and naturally his system was borked. I was a saint that day, and I helped him for an hour to get his system back. I actually recommended this same thread to him.

    My advice is don't do it. Don't manually install new things just for the sake of it.

    And let this thread rest in piece, so that others may find good advice in the future, instead of polluting it with unnecessary comments.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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