Installing Python 3.0 on Ubuntu 8.10 Intrepid Ibex
2008 December 4
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!
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
`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
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.
@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.
If you get any gcc errors try:
sudo apt-get install libc6-dev g++ gcc
before:
$ ./configure
@RM libc6-dev was listed, I added gcc and g++.
Thanks
[ot] For heaven’s sake. White JS snow on white background is just uselessly eating CPU cycles. Is this _really_ necessary?
@Pyth0n. you are right. I just couldn’t find where to remove this crappy option. removed now anyway. that was annoying dude.
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″.
As far as I experienced so far, make install keeps python 2.5 in place as the default.
As of today, ‘apt-get install python3′ installs RC3/Beta 3, not the release version.
for the gcc :
sudo apt-get install libc6-dev g++ gcc
Tutos Linux
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
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)?
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?
>>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
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.
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
@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.