-
Notifications
You must be signed in to change notification settings - Fork 464
Description
Bug Report: distutils is Removed in Python 3.12
Describe the bug
The distutils package, which includes StrictVersion, has been removed in Python 3.12. This causes issues in applications that rely on StrictVersion from distutils.version for version comparison, leading to import errors or broken functionality.
To Reproduce
Steps to reproduce the behavior:
- Use Python 3.12.
- Run a Django project that imports
StrictVersionfromdistutils.version. - Observe the import error caused by the removal of
distutils.
Expected behavior
The code should work without import errors and continue to perform version comparisons as expected. Ideally, the use of StrictVersion should be replaced with a compatible alternative that works in Python 3.12, such as Version from the packaging.version module.
Screenshots
Not applicable for this issue.
System (please complete the following information):
- OS: [e.g. Ubuntu 22.04]
- Python version: 3.12
- Lib version: [e.g. Django 4.2, notifications 1.8.2]
Additional context
The recommended fix is to replace StrictVersion with Version from the packaging.version module, as distutils is deprecated and removed in Python 3.12. This ensures compatibility with the latest Python versions.