fix: use setuptools>=68.0.0 for Python 3.12+ (distutils removed)#1222
Open
molhamfetnah wants to merge 196 commits intoopencv:masterfrom
Open
fix: use setuptools>=68.0.0 for Python 3.12+ (distutils removed)#1222molhamfetnah wants to merge 196 commits intoopencv:masterfrom
molhamfetnah wants to merge 196 commits intoopencv:masterfrom
Conversation
Run pipelines on 5.x branch
* Scheduled rolling workflows * Fixed a bug in commit/date for package version * Changed the name of Windows pipelines
* Scheduled rolling workflows * Fixed a bug in commit/date for package version * Changed the name of Windows pipelines
(5.x) Merge 4.x
* Added zlib build from the source on Linux, handling auditwheel issues * Removed unused variable * Removed bzip2 from dependencies for OpenCV Python packages
…) (opencv#718) * Added zlib build from the source on Linux, handling auditwheel issues * Removed unused variable * Removed bzip2 from dependencies for OpenCV Python packages
Update 5.x branch
OpenCV dependnecies update.
…n_win Stick to CMake 3.24 on Windows to work around 3.25 regression
Update pypi default index url
--------- Co-authored-by: Alexander Smorkalov <alexander.smorkalov@opencv.ai>
Musllinux wheels opencv#1099 added
Manylinux CI cleanup
allow numpy 2.3
Update submodules to release 4.13.0
Cherry-pick Numpy 2.4.x types fix.
…_4.13.0 Dependencies update for 4.13.0 release.
Switched MacOS Intel builds to own host
Added Python 3.14 support to CI
…AKAZE Add KAZE and AKAZE license
…_headless Disable libavdevice for headless builds on Linux to get rid of X libs dependency
Fixed upload path in twine release.
Python 3.12 removed distutils from stdlib. setuptools>=68 includes the distutils module in setuptools._distutils, ensuring compatibility with Python 3.12+ builds.
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ModuleNotFoundError: No module named distutilsoccurs during installationpyproject.tomlto requiresetuptools>=68.0.0for Python 3.12+setuptools._distutilsChanges
pyproject.toml: Changedsetuptools<70.0.0tosetuptools>=68.0.0for Python 3.12+Root Cause
Python 3.12 removed
distutilsfrom the standard library. Older setuptools versions still rely onimport distutilsinternally, causing failures on Python 3.12+. setuptools 68.0.0+ includessetuptools._distutilswhich provides the needed compatibility layer.Testing
Compatibility
cc: @opencv-python/admins