Installing Python 3.0 on Ubuntu 8.10 Intrepid Ibex

2008 December 4
by Tzury Bar Yochay

UPDATE (Dec, 7): apt-get install python3 works now. this might be the prefered way for most of us.

Based on sofen’s blog’s post about python 2.6

This was the easiest thing I did recently. It went so smooth that this post is totally redundant.

Seven commands and you are all unicode.

Step 1: Make sure you got all the prerequisites

$ sudo apt-get install build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libbz2-dev libc6-dev libsqlite3-dev tk-dev g++ gcc

Step 2: Grab the bits, extract them and build them

$ wget http://www.python.org/ftp/python/3.0/Python-3.0.tgz
$ tar xvzf Python-3.0.tgz
$ cd Python-3.0/
$ ./configure
$ make
$ sudo make install

That’s it my friend. You now have the best software development platform in the entire universe!

$ python3.0
Python 3.0 (r30:67503, Dec  4 2008, 21:27:40)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Good luck and enjoy the sweetness of open source software!

19 Responses leave one →
  1. 2008 December 5
    sebn permalink

    The following modules failed for me: _dbm _tkinter

    Solution for _dbm: http://bugs.python.org/issue4483
    $ cd Python-3.0/
    $ wget http://bugs.python.org/file12234/dbm.diff
    $ patch -p0 < dbm.diff
    $ ./configure –prefix=/usr/local

    Solution for _tkinter:
    $ sudo apt-get install tk8.5 tk8.5-dev

  2. 2008 December 5

    `make install` is evil because its result is unmanageable. Thus, in many cases there is even no way to uninstall such software. Not to mention such things as dependencies etc.

    The proper way is getting the source package using ‘apt-get source python3.0′ and tweaking it to work with newer upstream source.

    However, this can be more difficult and to make a halfway you may build the package from source using checkinstall. Alternatively, it’s possible to use equivs to trick the package management system: http://www.debian.org/doc/manuals/apt-howto/ch-helpers.en.html

    Best Regards,
    Timur

  3. 2008 December 6
    Nick permalink

    Thanks, easy to understand and super simple guide. Helped me since I am a complete novice to both Ubuntu and Python, and I couldn’t make heads or tails of any official documentation.

  4. 2008 December 6

    @sben, I will check this on a new installed machine and update this as necessary.
    @timur, checkinstall was the option in previous preview releases. Python 3.0 is now production ready and live side by side with previous installation.

  5. 2008 December 6

    If you get any gcc errors try:

    sudo apt-get install libc6-dev g++ gcc

    before:

    $ ./configure

  6. 2008 December 6

    @RM libc6-dev was listed, I added gcc and g++.
    Thanks

  7. 2008 December 10

    [ot] For heaven’s sake. White JS snow on white background is just uselessly eating CPU cycles. Is this _really_ necessary?

  8. 2008 December 10

    @Pyth0n. you are right. I just couldn’t find where to remove this crappy option. removed now anyway. that was annoying dude.

  9. 2008 December 10

    Thank you for de-snowing!

    As a note to P3k on Ubuntu (and all other Debian spinoffs) – system management strongly depends on properly operating Python environment. I would suggest using
    make altinstall
    in place of
    make install
    as the latter may harm the system by overwriting default Python2.5 links. After use of “altinstall” you have P3k accessible as “python3.0″.

  10. 2008 December 10

    As far as I experienced so far, make install keeps python 2.5 in place as the default.

  11. 2008 December 16
    Bart permalink

    As of today, ‘apt-get install python3′ installs RC3/Beta 3, not the release version.

  12. 2008 December 20

    for the gcc :
    sudo apt-get install libc6-dev g++ gcc

    Tutos Linux

  13. 2009 January 3
    gfdgdf permalink

    IT installs RC3/Beta 3 and the best option is to install with altinstal option because
    as it is said it is ovewriting the default installation

  14. 2009 January 17
    Clayton permalink

    After running these scripts in terminal to install, are there any folders that can be deleted that are no longer necessary (other than the tar balls of course)?

  15. 2009 February 5
    cae permalink

    using apt-get install python3 is easy but after installing,

    python -V still shows Python 2.5.2

    how can we made ubuntu default to python 3 instead of 2.5.2?

  16. 2009 February 13
    karlzt permalink

    >>how can we made Ubuntu default to python 3 instead of 2.5.2?

    you can’t do that unless you want to make your own distribution

  17. 2009 February 14

    from the sudo make install stdout

    * Note: not installed as ‘python’.
    * Use ‘make fullinstall’ to install as ‘python’.
    * However, ‘make fullinstall’ is discouraged,
    * as it will clobber your Python 2.x installation.

  18. 2009 March 27
    jerzyo permalink

    Hi, I am using ubuntu 8.04 and I want to install python 2.6 not python3
    What repositories do you use? Because I do not see any of the packages you are mentioning

    Jurek

  19. 2009 March 27

    @jerzyo, I believe that is you will follow the steps and just replace the version 3.0 tarball with version 2.6 (http://python.org/ftp/python/2.6.1/Python-2.6.1.tgz) you will get the same results.

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS