how to install python distutils

Neo picture Neo · Sep 28, 2010 · Viewed 205.5k times · Source

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.

Answer

ettanany picture ettanany · May 10, 2018

I know this is an old question, but I just come across the same issue using Python 3.6 in Ubuntu, and I am able to solve it using the following command:

sudo apt-get install python3-distutils