views:

25

answers:

3

I just got some space on a VPS server(running on ubuntu 8.04), and I'm trying to install django on it. The server has python 2.5 installed, but I guess its non standard installation. When I run install script for django, I get

amitoj@ninja:~/Django-1.2.1$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    from distutils.core import setup
ImportError: No module named distutils.core

I'm stumped. All the articles on internet tell me how to install modules using distutils. But how do I get distutils itself? Can anyone point me to the archive for distutils? I looked in /usr/lib/local/python2.5, /usr/lib/python2.5 etc, and as expected there is no distutils to be found.

A: 

You can install the python-distutils package. sudo apt-get install python-distutils should suffice.

Manoj Govindan
Can't do that. Its a VPS server, I don't have sudo privileges. I'm thinking of installing a local python. Either that, or I find distutils archive for python 2.5.
Neo
If you are installing local Python switch to 2.6 or 2.7 They come with `distutils` bundled.
Manoj Govindan
A: 

You can try installing Python 2.6,

sudo apt-get install python2.6

This should install the latest Python and also distutils package.

sheki
I can't do a sudo. I guess, I will have to get a local installation of Python.
Neo
A: 

The simplest way to install setuptools when it isn't already there and you can't use a package manager is to download ez_setup.py and run it with the appropriate Python interpreter. This works even if you have multiple versions of Python around: just run ez_setup.py once with each Python.

Duncan
Thanks for the reply, but it didn't work. I get this " import _md5ImportError: No module named _md5" error. The basic python installation is pretty screwed up I guess. I'll go with local install. Thanks a lot anyway.
Neo