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. When I run the Django installation script, I get:
amitoj@ninja:~/Django-1.2.1$ python setup.py installTraceback (most recent call last): File "setup.py", line 1, in <module> from distutils.core import setupImportError: No module named distutils.core
I found plenty of information about how to install packages using distutils; but how do I get distutils itself?
Note that Setuptools includes a modified version of distutils that includes sub-modules which were never part of the original distutils. See stdlib's distutils vs setuptools' distutils. When these sub-modules are needed, Setuptools must be installed anyway.
Also note that Setuptools is needed to get this functionality for Python 3.12 onward, because Distutils has been removed from the standard library. See Why did I get an error ModuleNotFoundError: No module named 'distutils'?. It may also be necessary within virtual environments, as in Windows: ModuleNotFoundError: No module named 'distutils'.
However, if you have an ordinary Python distribution, 3.11 or older, which came with the system, on Ubuntu, and a setup.py
or other code which is looking for the standard distutils
functionality - the problem is that the Ubuntu maintainers have not included it with the bundled Python. It needs to be installed using the system package manager, as described in answers here.