ModuleNotFoundError: No module named ‘distutils’

Compatibility issue: Django 2.2 is not compatible with Python 3.12. Django 2.2 reached end-of-life in April 2022 and doesn’t support Python versions beyond 3.9.The specific error: The distutils module, which Django 2.2 relies on, was removed from Python’s standard library in Python 3.12.

Solution

Temporary fix (not recommended for production): You can try installing setuptools which provides a backport of distutils:

pip install setuptools

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Select your currency
EGP Egyptian pound