- Notifications
You must be signed in to change notification settings - Fork901
Closed
Labels
Description
Expected behaviour
opencv-python builds on MacOS
Actual behaviour
Receive an error stating:
ERROR: Cannot install numpy==1.21.2 and numpy==1.21.4 because these package versions have conflicting dependencies. The conflict is caused by: The user requested numpy==1.21.2 The user requested numpy==1.21.4
- operating system == 12.6
- architecture (e.g. x86) == x86
- opencv-python version == 4.7.0.68 (commit339bca5 on 4.x branch)
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
Fix
To me, this looks like an issue in thepyroject.toml
requires array, with conflicting versions if your are running python >= 3.10 on Mac.
Specifically these lines:
"numpy==1.21.2; python_version>='3.10'", "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'",
should probably be:
"numpy==1.21.2; python_version>='3.10' and platform_system!='Darwin'", "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'",
Otherwise when python >= 3.10 and platform_system == "Darwin" it will want both numpy 1.21.2 (to satisfy the first condition) and numpy 1.21.4 (to satisfy the second).