Skip to main content

Wrapper package for OpenCV python bindings.

Reason this release was yanked:

Release deprecated

Project description

Unofficial OpenCV packages for Python.

This package contains only the OpenCV core modules without the optional contrib modules. If you are looking for a version which includes OpenCV contrib modules, please install opencv-contrib-python instead.

The packages contain pre-compiled OpenCV binary with Python bindings. This enables super fast (usually < 10 seconds) OpenCV installation for Python.

If you need only OpenCV Python bindings, no separate OpenCV installation is required.

Installation and Usage

  1. If you have previous/other version of OpenCV installed (e.g. cv2 module in the root of Python’s site-packages), remove it before installation to avoid conflicts.

  • To further avoid conflicts and to make development easier, Python’s virtual environments are highly recommended for development purposes.

  1. If you have an existing opencv-contrib-python installation, run pip uninstall opencv-contrib-python

  2. Install this package:

pip install opencv-python

  1. Import the package:

import cv2

The package contains haarcascade files. cv2.data.haarcascades can be used as a shortcut to the data folder. For example:

cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")

  1. Read OpenCV documentation

  2. Before opening a new issue, read the FAQ below and have a look at the other issues which are already open.

Frequently Asked Questions

Q: Do I need to install also OpenCV separately?

A: No, the packages are special wheel binary packages and they already contain statically built OpenCV binaries.

Q: Pip does not find package ``opencv-python``?

A: The wheel package format and manylinux builds are pretty new things. Most likely the issue is related to too old pip and can be fixed by running pip install --upgrade pip and pip install wheel.

Q: I need contrib modules?

A: Please install opencv-contrib-python instead. However, note that commercial usage might be restricted in some countries since the contrib modules might contain some non-free/patented algorithms.

Q: Import fails on Windows to some DLL load error?

A: If the import fails on Windows, make sure you have Visual C++ redistributable 2015 installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.

See also this issue if you are using Anaconda.

Q: I have some other import errors?

A: Make sure you have removed old manual installations of OpenCV Python bindings (cv2.so or cv2.pyd in site-packages).

Documentation for opencv-python

AppVeyor CI test status (Windows) Travis CI test status (Linux and OS X)

The aim of this repository is to provide means to package each new OpenCV release for the most used Python versions and platforms.

At the same time it allows anyone to build a custom version of OpenCV for any Python version: just fork this repo and modify the build files and scripts to fit your needs.

Build process

The project is structured like a normal Python package with a standard setup.py file. The build process for a single entry in the build matrices is as follows (see for example appveyor.yml file):

  1. Checkout repository and submodules

    • OpenCV is included as submodule and the version is updated manually by maintainers when a new OpenCV release has been made

    • Contrib modules are also included as a submodule

  2. Find OpenCV version from the sources

  3. Install dependencies (numpy)

  4. Build OpenCV

    • tests are disabled, otherwise build time increases too much

    • there are 2 build matrix entries for each build combination: with and without contrib modules

    • Linux builds run in manylinux Docker containers (CentOS 5)

  5. Copy each .pyd/.so file to cv2 folder of this project and generate wheel

    • Linux and macOS wheels are checked with auditwheel and delocate

  6. Install the generated wheel

  7. Test that Python can import the library and run some sanity checks

  8. Use twine to upload the generated wheel to PyPI (only in release builds)

Currently the find_version.py file parses OpenCV version information from the OpenCV sources. OpenCV depends on numpy, so setup.py checks the minimum required numpy version also with the help of pip.

The cv2.pyd/.so file is normally copied to site-packages. To avoid polluting the root folder this package wraps the statically built binary into cv2 package and __init__.py file in the package handles the import logic correctly.

Since both opencv-python and opencv-contrib-python use the same namespace explained above, it is highly recommended to uninstall the other package before switching from example from opencv-python to opencv-contrib-python package.

Licensing

Opencv-python package (scripts in this repository) is available under MIT license.

OpenCV itself is available under 3-clause BSD License (LICENSE-3RD-PARTY.txt).

All wheels ship with FFmpeg licensed under the LGPLv2.1.

Linux and MacOS wheels ship with Qt 4.8.7 licensed under the LGPLv2.1.

Versioning

Currently the find_version.py script searches for the version information from OpenCV sources and appends also a revision number specific to this repository to the version string.

Releases

A release is made and uploaded to PyPI when a new tag is pushed to master branch. These tags differentiate packages (this repo might have modifications but OpenCV version stays same) and should be incremented sequentially. In practice, release version numbers look like this:

cv_major.cv_minor.cv_revision.package_revision e.g. 3.1.0.0

Development builds

Every commit to the master branch of this repo will be built. Possible build artifacts use local version identifiers:

cv_major.cv_minor.cv_revision+git_hash_of_this_repo e.g. 3.1.0+14a8d39

These artifacts can’t be and will not be uploaded to PyPI.

Manylinux wheels

Linux wheels are built using manylinux. These wheels should work out of the box for most of the distros (which use GNU C standard library) out there since they are built against an old version of glibc.

Supported Python versions

Python 2.7 is the only supported version in 2.x series. Python 3.x releases follow Numpy releases, for example Python 3.3 is no longer supported by Numpy so the support for it has been dropped in opencv-python too.

Currently, builds for following Python versions are provided:

  • 2.7

  • 3.4

  • 3.5

  • 3.6

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

opencv_python-3.4.0.12-cp36-cp36m-win_amd64.whl (33.3 MB view details)

Uploaded CPython 3.6mWindows x86-64

opencv_python-3.4.0.12-cp36-cp36m-win32.whl (22.8 MB view details)

Uploaded CPython 3.6mWindows x86

opencv_python-3.4.0.12-cp36-cp36m-manylinux1_x86_64.whl (24.9 MB view details)

Uploaded CPython 3.6m

opencv_python-3.4.0.12-cp36-cp36m-manylinux1_i686.whl (25.0 MB view details)

Uploaded CPython 3.6m

opencv_python-3.4.0.12-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (41.2 MB view details)

Uploaded CPython 3.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

opencv_python-3.4.0.12-cp35-cp35m-win_amd64.whl (33.3 MB view details)

Uploaded CPython 3.5mWindows x86-64

opencv_python-3.4.0.12-cp35-cp35m-win32.whl (22.8 MB view details)

Uploaded CPython 3.5mWindows x86

opencv_python-3.4.0.12-cp35-cp35m-manylinux1_x86_64.whl (24.9 MB view details)

Uploaded CPython 3.5m

opencv_python-3.4.0.12-cp35-cp35m-manylinux1_i686.whl (25.0 MB view details)

Uploaded CPython 3.5m

opencv_python-3.4.0.12-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (41.2 MB view details)

Uploaded CPython 3.5mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

opencv_python-3.4.0.12-cp34-cp34m-win_amd64.whl (33.3 MB view details)

Uploaded CPython 3.4mWindows x86-64

opencv_python-3.4.0.12-cp34-cp34m-win32.whl (22.8 MB view details)

Uploaded CPython 3.4mWindows x86

opencv_python-3.4.0.12-cp34-cp34m-manylinux1_x86_64.whl (24.9 MB view details)

Uploaded CPython 3.4m

opencv_python-3.4.0.12-cp34-cp34m-manylinux1_i686.whl (25.0 MB view details)

Uploaded CPython 3.4m

opencv_python-3.4.0.12-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (41.2 MB view details)

Uploaded CPython 3.4mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

opencv_python-3.4.0.12-cp27-cp27mu-manylinux1_x86_64.whl (24.9 MB view details)

Uploaded CPython 2.7mu

opencv_python-3.4.0.12-cp27-cp27mu-manylinux1_i686.whl (25.0 MB view details)

Uploaded CPython 2.7mu

opencv_python-3.4.0.12-cp27-cp27m-win_amd64.whl (33.3 MB view details)

Uploaded CPython 2.7mWindows x86-64

opencv_python-3.4.0.12-cp27-cp27m-win32.whl (22.8 MB view details)

Uploaded CPython 2.7mWindows x86

opencv_python-3.4.0.12-cp27-cp27m-manylinux1_x86_64.whl (24.9 MB view details)

Uploaded CPython 2.7m

opencv_python-3.4.0.12-cp27-cp27m-manylinux1_i686.whl (25.0 MB view details)

Uploaded CPython 2.7m

opencv_python-3.4.0.12-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (41.2 MB view details)

Uploaded CPython 2.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

Details for the file opencv_python-3.4.0.12-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3cbb46a9cb8a301ef3d2f394b6ddc379b7d1de296f3f1f8f39756e7d5c29cdf6
MD5 e6d9abf15a96f7a554c61aadff3c612f
BLAKE2b-256 4c25151aeb11e80f99b97d3eb93a2c98bcacd857f28c4fb8865eb0201d800e97

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 e31a4fe3818ea0c776c74e3c7c407996a757c6593fcbb3bc4223687504a89749
MD5 435cf99339fa0680dfc903ebbdea6cf4
BLAKE2b-256 a2522a4627eeea42a1b32740412961b4e506a253cd69d9e9ccf7f277521fb72c

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a73b7d655b2ac56f1309e85d26a310bc960356616b84474f863cb7cd0b85daaf
MD5 3001f185932ff46448cdfe54ab26e830
BLAKE2b-256 50f95c454f0f52788a913979877e6ed9b2454a9c7676581a0ee3a2d81db784a6

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f162f7c4e11cf87346867b8287c543b980976b333cd1eb4fd956034b53c6dff5
MD5 2fc563142d499dc31669223ad225f82c
BLAKE2b-256 73b4107c1037363de433e455bdaff772449e561bf35be1aae8029bbfd952ff9a

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 d46d4e2a8e3a81e7559c6b393bb276cba148fe45cc555a77559911ae9f444fb7
MD5 04343b3e865c348960a7d75c1a9212bc
BLAKE2b-256 958b89d27a57653ac6e8e0d8bdd261b14b792c9affe16b5b453db9f6aa1ddb68

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 776c971e26464ecc6e2417d7f4f2300da72f891a81acf5616cc63c9344a2679b
MD5 f8294a0ab1006bd00e6b7ce3710a8547
BLAKE2b-256 8b7972e8b5326ebecb101e760561de883ce2a66fdafcb238aa00d92c65d40efd

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 1e06996ff9ed99170aa473099f9dcbaf424f456ae4274205219a09cade104691
MD5 fd53cfdb44ee62eb076329d5d3303981
BLAKE2b-256 e849665a3ccb20c74dbf26bc373a5ebdae300eb0f79413eb1798f8e4202666b8

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f34b19e2b879d8d3201600bfafb4b29fb40ac09f9704e96916a8e522944f8395
MD5 87a6c0f3b3adb40e712d8914321c6bd8
BLAKE2b-256 47c8dc070fd7b4fbb979f01115839f9d81a4936fe2b57eb5f0641911b895754c

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b2c85f7809dfc5944653296f19008f9cc1a9a035bdc7857678db499006d8dcd1
MD5 b811686f496285b314271b9b17f4798d
BLAKE2b-256 c6e706efa650fe49c468a956dc6e5f060900e3045d2fc8ce35eaeeba48296f4a

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 adc304007b5adbaf739dc31e57b363bf2373f7da316c25a7e363f648075edb98
MD5 799c1bf73b67e3f1fca09a4257109764
BLAKE2b-256 efdc9127645c957c3cf53ff9809c220d0b5f8fd1a35634924c79168942f54df7

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 5e3d742d8d8c73ad9717d27be3d42561873aa581b9a472197b094fb0f5d3d74a
MD5 d74acf11800c153f089c330e5a730966
BLAKE2b-256 0063640f25926d07f29050d5227d5f0d9c35d8e27d7fcbc413a553a59d9432ed

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 78a45fe1f4f2a8101b94b848f568846235c91647be1eb84284c1772d4eb7b824
MD5 c1be8f66b5bd38d8f9f2aa01ba611668
BLAKE2b-256 cd9a7d246170187aea47221bcc8d2bd4ac8f22114f26ef60c0873136e4252df3

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1348a80b5be4d5b94f8b6152ec34202c864b2c861cbbf17f328168ca712e2781
MD5 719caeeb3cb73600490ac0cd0979d084
BLAKE2b-256 67f53b6678ed6bc63c6a1d94c91708f9541fb35c63eaf5b11e82c7715b00ba3f

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f68995482d912dcaea884da1b60d7cced64a7cd9dd30f4c688ffebe245d11982
MD5 034979e418cfd1abb85d63931feca0ec
BLAKE2b-256 1039a76c2e2f21d6d8ad8c33f82317fde25d8f002a0c16a693b44ddc3a8ceef0

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 b80ffde508e005aab6401312b62d2fc4f11556090011b00cd890a193c8b9737b
MD5 dc9eebe6c8b3a970c2e3830cf2fe205e
BLAKE2b-256 2b4fd65a12e9602eff592b0e1e0b9bfe006681ec2d8bab1a9aaefc0e6af3f274

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7f4fe54b0e07d67c63a0309a7d397e9e94d7e3465ec2b070666cebc4ea9889ae
MD5 8fc4914a8bbdecd70b6bc8e093d739a0
BLAKE2b-256 57810a678c3f457f880c26ab4bd32c4bdcd3fb6fa5d335e9e8683798d290c9b3

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 15f0ede983153dae21820b2346b1608d266618bf4cbc4a2941ae8326d9981f3e
MD5 a72138d34cc1013cbc52010335708a99
BLAKE2b-256 90da0f5ba7f7cfd6f67b3a4d68814a2a1cddc75462dfed45beeaffb7694c82cb

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 d3cdae3bae25f52fc3bcaee2b0a476d85df5ae2ee4d2c46efc0ca9ea44438974
MD5 6af4099059bc254042b534bc17df1164
BLAKE2b-256 12784118e6bed0ce164289cbaac5cfbaff018c21ef36703d6e58f1b591937fcd

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 090eead5a4540153332a6b9739f86292dc86276c6620dbfad77d489171fe9d6f
MD5 1a49017109490073125f17b0690d4807
BLAKE2b-256 771d0bec9694a4b6ba0d332f04780c37d0b2834128a130492be0db01e196075d

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8a38b57557cd019fe3510e902080d6682c278e76cdef5ff240020faa8d7ba5a0
MD5 78646033e2e849f44b166d1398c09453
BLAKE2b-256 e13f36af9bb6b4cd996fa58889dc49b976d537cad87e3180cae8761963b6ba1a

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 3775e938d7be26a7b73a043470d25710cab4f49d49b4f81f4e95082a3be76642
MD5 3a5cc15d3318a874f60835a24295e223
BLAKE2b-256 4fbed1f0c468606ab2673b84df3675834c0c75252bbe8dd0cda2da5b22c4717f

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.0.12-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.0.12-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 86a436b17337d888abe4c892a850af23b1692dab25045e27d62160691f494835
MD5 35b07856aa3c1ce24bfe95865b750413
BLAKE2b-256 d613e80623e199d031da0182da2ba08b0fd9a573dfb74b1af37c87b64cfcf08c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page