opencv-python
RepositoryFreeWrapper package for OpenCV python bindings.
Capabilities11 decomposed
multi-platform pre-built wheel distribution for opencv bindings
Medium confidenceDistributes pre-compiled OpenCV Python bindings as binary wheels across Windows (x86_64, x86), Linux (x86_64, i686, aarch64), and macOS (x86_64, arm64) for Python 3.7-3.12, eliminating the need for developers to compile OpenCV from source. Uses manylinux2014 standard for Linux wheels to ensure compatibility across diverse distributions. The build system automatically manages git submodules to pull the correct OpenCV C++ source version, compiles it with platform-specific optimizations, and packages the resulting extension modules into distributable wheels via a custom pyproject.toml backend.
Uses a custom PEP 517 build backend (in _build_backend/backend.py) to orchestrate multi-stage compilation and packaging, with git submodule management to pin exact OpenCV versions and automated CI/CD across 3 major OS families and 5+ architectures simultaneously
Faster installation than source-based opencv-python builds (seconds vs minutes) and broader platform coverage than conda-only distributions, with explicit headless variants optimized for server/container deployments
package variant selection for environment-specific optimization
Medium confidenceProvides four distinct package variants (opencv-python, opencv-contrib-python, opencv-python-headless, opencv-contrib-python-headless) allowing developers to select the exact feature set and dependencies needed for their deployment context. The build system conditionally includes GUI components (Qt 5, X11 libraries) only in non-headless variants, and conditionally includes contrib modules (extra algorithms, experimental features) only in -contrib variants. This is managed through CMake configuration flags passed during the C++ compilation stage, reducing final wheel size and dependency footprint by 30-40% for headless deployments.
Maintains four independently-built wheel variants with different CMake feature flags and dependency trees, all from a single source repository, with automated CI/CD matrix builds ensuring consistency across variants
More granular control than monolithic opencv packages; headless variants are significantly smaller than alternatives that bundle GUI libraries unconditionally
python version-specific wheel building for 3.7-3.12 compatibility
Medium confidenceBuilds separate wheels for each supported Python version (3.7, 3.8, 3.9, 3.10, 3.11, 3.12) by compiling against version-specific Python headers and ABI (Application Binary Interface). The build system detects the Python version during compilation and generates extension modules with the correct ABI tag (e.g., cp39 for CPython 3.9). The CI/CD pipeline maintains separate build jobs for each Python version, ensuring that wheels are compatible with their target Python interpreter. This approach avoids ABI incompatibilities that would occur if a single wheel were used across multiple Python versions, which have different memory layouts and API signatures.
Maintains separate CI/CD build jobs for 6 Python versions (3.7-3.12) with version-specific ABI tags, ensuring wheels are compatible with their target Python interpreter without ABI conflicts
More compatible than universal wheels that attempt to support multiple Python versions; clearer than relying on users to compile from source for their specific Python version
semantic versioning with package revision tracking
Medium confidenceImplements a four-part versioning scheme (cv_major.cv_minor.cv_revision.package_revision) that decouples OpenCV upstream versions from packaging-specific revisions. For example, 4.8.0.2 indicates OpenCV 4.8.0 with package revision 2 (second packaging iteration). Development builds append git hash identifiers (e.g., 4.8.0+abc1234) to enable tracking of unreleased builds. This allows maintainers to issue packaging fixes, dependency updates, or platform-specific patches without waiting for upstream OpenCV releases, while maintaining clear traceability to the underlying OpenCV version.
Decouples packaging revisions from upstream OpenCV versions via a fourth version component, enabling independent patch releases and development build tracking without requiring upstream OpenCV updates
More transparent than conda-only versioning schemes that obscure packaging iterations; clearer than monolithic version bumps that conflate upstream and packaging changes
custom pep 517 build backend with cmake orchestration
Medium confidenceImplements a custom Python build backend (in _build_backend/backend.py) that extends PEP 517 standards to orchestrate complex multi-stage compilation. The backend manages git submodule initialization, invokes CMake to configure the OpenCV C++ build with platform-specific flags, compiles extension modules via setuptools, and packages results into wheels. This abstraction allows setup.py to remain relatively simple while delegating platform-specific logic (Windows MSVC vs Unix Makefiles, architecture detection, dependency resolution) to the backend. The backend also handles patching of OpenCV source code before compilation, enabling fixes or customizations without forking the upstream repository.
Custom PEP 517 backend (backend.py) abstracts platform-specific compilation logic, enabling a single setup.py to support Windows/macOS/Linux and multiple architectures via conditional CMake configuration and compiler detection
More flexible than setuptools-only builds for complex C++ projects; cleaner than monolithic setup.py files that embed all platform logic inline
git submodule-based opencv source pinning
Medium confidenceMaintains the OpenCV C++ source code as a git submodule, allowing the opencv-python repository to pin exact OpenCV versions without duplicating source code. When a new OpenCV release is made, maintainers manually update the submodule reference to point to the new tag/commit. The build system automatically initializes and checks out the submodule during the build process, ensuring reproducible builds across different machines and CI/CD environments. This approach decouples the opencv-python release cycle from OpenCV's, allowing packaging updates or patches to be released independently.
Uses git submodules to maintain a clean separation between packaging infrastructure and OpenCV source, with automatic submodule initialization during build, enabling independent release cycles
Cleaner than vendoring full OpenCV source (reduces repository size); more reproducible than downloading source at build time from URLs
multi-platform ci/cd matrix builds with automated testing
Medium confidenceImplements an automated CI/CD pipeline (documented in CI/CD Pipeline section) that builds wheels across 3 major operating systems (Windows, macOS, Linux), 5+ CPU architectures (x86_64, x86, i686, aarch64, arm64), and 6 Python versions (3.7-3.12) in parallel. Each platform has a dedicated workflow (Linux Build Workflow, macOS Build Workflow, Windows Build Workflow) that handles platform-specific build steps, compiler selection, and dependency installation. The pipeline automatically triggers on new OpenCV releases (via submodule updates) and packaging changes, runs basic smoke tests on built wheels, and publishes successful builds to PyPI. Docker build environments ensure consistent compilation across different CI/CD runners.
Maintains separate, platform-specific CI/CD workflows (Linux/macOS/Windows) with Docker-based build environments to ensure reproducible compilation across heterogeneous runner types, with automated PyPI publishing on success
More comprehensive platform coverage than single-platform CI systems; Docker-based environments are more reproducible than relying on pre-installed system dependencies
headless variant compilation with conditional gui dependency exclusion
Medium confidenceBuilds headless package variants by passing CMake flags that exclude GUI-related dependencies (Qt 5, X11 libraries, GTK) during the C++ compilation stage. The build backend detects the target variant (via environment variables or setup.py configuration) and conditionally invokes CMake with -DBUILD_SHARED_LIBS=OFF, -DWITH_QT=OFF, and similar flags. This results in significantly smaller wheels (30-40% reduction) and eliminates transitive dependencies on heavy GUI libraries, making headless variants ideal for Docker containers, serverless functions, and cloud deployments where GUI functionality is unnecessary. The Python bindings remain functionally identical except for GUI-specific functions (cv2.imshow, cv2.waitKey) which raise NotImplementedError.
Conditionally compiles OpenCV with GUI dependencies disabled via CMake flags, producing 30-40% smaller wheels with identical Python API except for GUI-specific functions that raise NotImplementedError
More efficient than shipping full wheels and relying on users to uninstall GUI libraries; cleaner than separate codebases for desktop vs server variants
manylinux2014 wheel compatibility standard for broad linux distribution support
Medium confidenceBuilds Linux wheels using the manylinux2014 standard (PEP 599), which targets glibc 2.17 and older, ensuring compatibility across CentOS 7, Ubuntu 14.04+, Debian 8+, and most modern Linux distributions. The build system uses Docker containers with manylinux2014 base images to compile against the correct glibc version and system libraries, then uses auditwheel to verify and repair wheels by bundling necessary shared libraries (libstdc++, libgomp) into the wheel. This approach eliminates the need for users to have specific system libraries installed, making wheels portable across diverse Linux environments without requiring source compilation.
Uses Docker-based manylinux2014 build environments with auditwheel to bundle necessary shared libraries into wheels, ensuring portability across Linux distributions without requiring system-level dependency installation
Broader Linux compatibility than wheels built on single distributions; more portable than requiring users to install system libraries or compile from source
third-party binary license management and disclosure
Medium confidenceManages licensing for bundled third-party binaries (FFmpeg, Qt 5, and others) by including a LICENSE-3RD-PARTY.txt file in distributions that lists all licenses and their terms. FFmpeg is included in all wheels under LGPLv2.1, Qt 5 is included in non-headless Linux wheels under LGPLv3, and other binaries have their respective licenses documented. The build system automatically bundles these binaries during compilation and ensures license files are included in the final wheel. This approach provides legal transparency and ensures compliance with open-source licensing requirements, particularly important for commercial users who need to understand licensing obligations.
Explicitly documents and bundles third-party binary licenses (FFmpeg, Qt 5) in wheels with a dedicated LICENSE-3RD-PARTY.txt file, providing legal transparency for commercial users
More transparent than packages that obscure third-party dependencies; clearer than relying on users to discover licenses independently
architecture-specific wheel building for x86, x86_64, i686, aarch64, and arm64
Medium confidenceBuilds separate wheels for each supported CPU architecture (x86, x86_64, i686, aarch64, arm64) by detecting the target architecture during the build process and passing architecture-specific compiler flags to CMake. The CI/CD pipeline maintains separate build jobs for each architecture, with aarch64 and arm64 builds running on appropriate runners (e.g., AWS Graviton instances for aarch64, Apple Silicon for arm64). This enables users to install architecture-native wheels that are optimized for their specific CPU, improving performance through architecture-specific SIMD instructions and memory layouts. The build system automatically selects the correct wheel during pip install based on the runtime Python interpreter's architecture.
Maintains separate CI/CD build jobs for 5+ CPU architectures (x86, x86_64, i686, aarch64, arm64) with architecture-specific compiler flags, enabling native wheels optimized for each platform
More performant than universal wheels or emulated execution; broader architecture support than single-architecture distributions
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with opencv-python, ranked by overlap. Discovered automatically through the match graph.
these
instructions to install `uv` / `uvx` and [these](https://pip.pypa.io/en/stable/installation/) to install `pip`.
Anaconda
Streamline data science and AI workflows with comprehensive...
StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
fast-stable-diffusion
fast-stable-diffusion + DreamBooth
onnx
Open Neural Network Exchange
llama.cpp
C/C++ LLM inference — GGUF quantization, GPU offloading, foundation for local AI tools.
Best For
- ✓Data scientists and ML engineers prototyping computer vision applications
- ✓DevOps teams deploying OpenCV to Docker containers and cloud platforms
- ✓Developers targeting multiple platforms who need consistent binary behavior
- ✓Backend engineers deploying computer vision services in containerized/serverless environments
- ✓Researchers needing access to contrib modules for advanced algorithms
- ✓Teams with strict dependency management policies or minimal container images
- ✓Teams managing multiple Python versions across different projects or environments
- ✓Organizations gradually upgrading from older Python versions (3.7, 3.8) to newer ones
Known Limitations
- ⚠Pre-built wheels may not include custom OpenCV compilation flags or optional dependencies not included in the standard build
- ⚠Binary compatibility limited to officially supported platforms and architectures; custom hardware or exotic Linux distributions may require source compilation
- ⚠Wheel size varies significantly between headless and GUI variants (headless ~30-40% smaller due to no X11/Qt dependencies)
- ⚠opencv-contrib-python includes experimental/unstable algorithms that may change between versions
- ⚠Headless variants cannot display images via cv2.imshow() or use GUI-dependent features; requires alternative display mechanisms
- ⚠Switching between variants requires uninstalling and reinstalling; no single installation supports all variants simultaneously
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Package Details
About
Wrapper package for OpenCV python bindings.
Categories
Alternatives to opencv-python
Are you the builder of opencv-python?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →