Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python2.6

I'm trying to install python 2.6 on LinuxMint. I've came across a few issues.

The first thing I did was to download Python2.6.8 from the python website

Then, I've extracted the files, ran a

./configure --prefix=/opt/python-2.7.3 --with-threads --with-signal-module --with-pydebug

I found this here which I found here

When I run the make command, I get these errors:

Failed to find the necessary bits to build these modules:
_bsddb             _curses            _curses_panel   
_hashlib           _sqlite3           _ssl            
bsddb185           bz2                dbm             
dl                 gdbm               imageop         
linuxaudiodev      ossaudiodev        readline        
sunaudiodev                                           
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
crypt              nis                                

I have installed all the packages mentioned in the Cheater's page. I successfully installed python2.6 without all the options that I mentioned, but I can't get the bz2 module to work.

like image 693
Paco Avatar asked Apr 30 '13 11:04

Paco


People also ask

Can you still download Python 2?

The final version of Python 2.0 is available for download now.


1 Answers

I think you're probably missing a few development packages. Check that you have these:

dpkg -l libreadline-dev
dpkg -l zlib1g-dev
dpkg -l libssl-dev

Also, older versions of python don't look for files in the new locations where ubuntu (and I assume Mint by extension) installs them. You need to open up setup.py and look for the place where it defines the various library directories, eg this patch was needed to compile python2.4 on new ubuntus (and I see a fix like this is still necessary on 2.6):

diff -urNad python2.4-2.4.6-natty~/setup.py python2.4-2.4.6-natty/setup.py
--- python2.4-2.4.6-natty~/setup.py 2011-07-27 14:42:03.000000000 +0200
+++ python2.4-2.4.6-natty/setup.py  2011-07-27 15:03:35.000000000 +0200
@@ -269,6 +269,7 @@
         lib_dirs = self.compiler.library_dirs + [
             '/lib64', '/usr/lib64',
             '/lib', '/usr/lib',
+            '/usr/lib/i386-linux-gnu', '/usr/lib/x86_64-linux-gnu',
             ]
         inc_dirs = self.compiler.include_dirs + ['/usr/include']
         exts = []

But what I would personally do is grab the debian sources, and attempt to build the package from source.

Or you could just use the dead snakes ppa

like image 193
izak Avatar answered Oct 18 '22 01:10

izak