views:

295

answers:

1

I am trying to compile and install python2.6.4 on Debian 5.0.3 (64bit). I installed using 'make altinstall' as I want to keep python 2.5.2 that comes with Deb5.0 as my default python.

Following this, I installed setuptools 0.6c11 using the command 'sudo sh setuptools-0.6c11-py2.6.egg --prefix=/usr/local'. However, after installing when I try to 'import pkg_resources' from python2.6, it doesnt work saying 'ImportError: No module named pkg_resources'. Without pkg_resources, I can hardly do much.

Can someone share here what may be going wrong or what's missing?

A: 

Packaging and package integration is tricky. Debian has Python 2.6, but for some internal reason it is only in the experimental branch:

$ rmadison python2.6
 python2.6 |    2.6.2-2 |  experimental | source, ia64
 python2.6 |    2.6.4-1 |  experimental | source, alpha, amd64, armel, hppa, \
                                          i386, powerpc, s390, sparc

$

I would use that package as it is likely to be more fully integrated with the rest of python packaging. Plus, as it is a .deb, you can easily uninstall it.

And the debian-python list may be able to assist you further.

Dirk Eddelbuettel
Thanks for your quick info. Will try out with the experimental branch. I hope they support multiple-python installations.In the mean time, I downloaded setuptools-0.6c11.tar.gz and ran 'python2.6 setup.py build' followed by 'python2.6 setup.py install'. This shows me the required pkg_resources.py file and also created the .egg file. But, it doesn't copy the files to python2.6's site-packages folder.I just feel that I am missing something basic here (which I don't find in the docs).
Ethan Collins
Yes they will -- that's one of the advantages of going with the packages. My Ubuntu machines all have Python 2.4, 2.5 and 2.6 installed, and I could add Python 3.0 and 3.1 as well.
Dirk Eddelbuettel