Closed
Description
Expected behaviour
I tried to build the tag 80 in python 3.12, but build fails
Write here how did you expect the library to function.
correct build from source
Actual behaviour
Write here what went wrong.
install of some dependencies (i.e. numpy) fail with this error:
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
the dependencies versions of numpy and setuptools are outdated and broken in python 3.12. Is it possible to use latest versions of those packages?
Steps to reproduce
- example code: build from source as tutorial in main page
- operating system: Ubuntu 22.04
- architecture (e.g. x86): x86
- opencv-python version: 80
Issue submission checklist
- This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")I'm using the latest version of
opencv-python
Activity
asmorkalov commentedon May 30, 2024
https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean
EnricoBeltramo commentedon May 31, 2024
I already tried that and it didn't work.
asmorkalov commentedon Jun 3, 2024
#992
montmejat commentedon Jun 12, 2024
I'm also getting the same error with the latest merged updates:
zhanwenchen commentedon Jun 12, 2024
I encountered the same problem while running
pip wheel . --verbose |& tee install_opencv.log
. It worked after removing the==59.2.0"
from the"setuptools==59.2.0"
https://github.com/opencv/opencv-python/blob/4.x/pyproject.toml#L16.sibocw commentedon Jun 19, 2024
Thank you @zhanwenchen, I also encountered the same issue (even after following the StackOverflow answer above), and solved it the same way. I think the
==59.2.0
prevents pip from using the most up-to-date setuptools that has this API change addressed.Is there a particular reason why there's such a strict requirement for setuptools? Can I make a PR to remove it (or change it to
>=59.2.0
)?Support python 3.12
pip install
failed on Python 3.12+ #1059Support python 3.12
asmorkalov commentedon Jan 16, 2025
FIxed in #1061