Skip to main content

Wrapper package for OpenCV python bindings.

Project description

OpenCV on Wheels

Unofficial pre-built OpenCV packages for Python.

Installation and Usage

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

  2. Select the correct package for your environment:

    There are four different packages and you should select only one of them. Do not install multiple different packages in the same enviroment.

    a. Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)

    • run pip install opencv-python if you need only main modules
    • run pip install opencv-contrib-python if you need both main and contrib modules (check extra modules listing from OpenCV documentation)

    b. Packages for server (headless) environments

    These packages do not contain any GUI functionality. They are smaller and suitable for more restricted environments.

    • run pip install opencv-python-headless if you need only main modules
    • run pip install opencv-contrib-python-headless if you need both main and contrib modules (check extra modules listing from OpenCV documentation)
  3. Import the package:

    import cv2

    All packages contain 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")

  4. Read OpenCV documentation

  5. 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 fails with Could not find a version that satisfies the requirement ...?

A: Most likely the issue is related to too old pip and can be fixed by running pip install --upgrade pip. Note that PyPI does not currently support ARM architecture so you can't install these packages for example on Raspberry Pi.

Q: Import fails on Windows: ImportError: DLL load failed: The specified module could not be found.?

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.

If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see this issue for a manual fix.

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.

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 4 build matrix entries for each build combination: with and without contrib modules, with and without GUI (headless)
    • 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)

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 all packages use the same cv2 namespace explained above, uninstall the other package before switching for example from opencv-python to opencv-contrib-python.

Licensing

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

OpenCV itself is available under 3-clause BSD License.

Third party package licenses are at 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

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.

The default manylinux images have been extended with some OpenCV dependencies. See Docker folder for more info.

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 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

If you're not sure about the file name format, learn more about wheel file names.

opencv_python-3.4.1.15-cp36-cp36m-win_amd64.whl (33.6 MB view details)

Uploaded CPython 3.6mWindows x86-64

opencv_python-3.4.1.15-cp36-cp36m-win32.whl (23.0 MB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

opencv_python-3.4.1.15-cp36-cp36m-manylinux1_i686.whl (24.8 MB view details)

Uploaded CPython 3.6m

opencv_python-3.4.1.15-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.9 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.1.15-cp35-cp35m-win_amd64.whl (33.6 MB view details)

Uploaded CPython 3.5mWindows x86-64

opencv_python-3.4.1.15-cp35-cp35m-win32.whl (23.0 MB view details)

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

opencv_python-3.4.1.15-cp35-cp35m-manylinux1_i686.whl (24.8 MB view details)

Uploaded CPython 3.5m

opencv_python-3.4.1.15-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.9 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.1.15-cp34-cp34m-win_amd64.whl (33.6 MB view details)

Uploaded CPython 3.4mWindows x86-64

opencv_python-3.4.1.15-cp34-cp34m-win32.whl (23.0 MB view details)

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

opencv_python-3.4.1.15-cp34-cp34m-manylinux1_i686.whl (24.8 MB view details)

Uploaded CPython 3.4m

opencv_python-3.4.1.15-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.9 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.1.15-cp27-cp27mu-manylinux1_x86_64.whl (24.9 MB view details)

Uploaded CPython 2.7mu

opencv_python-3.4.1.15-cp27-cp27mu-manylinux1_i686.whl (24.8 MB view details)

Uploaded CPython 2.7mu

opencv_python-3.4.1.15-cp27-cp27m-win_amd64.whl (33.6 MB view details)

Uploaded CPython 2.7mWindows x86-64

opencv_python-3.4.1.15-cp27-cp27m-win32.whl (23.0 MB view details)

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7m

opencv_python-3.4.1.15-cp27-cp27m-manylinux1_i686.whl (24.8 MB view details)

Uploaded CPython 2.7m

opencv_python-3.4.1.15-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 (23.7 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.1.15-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2cea809afe32cdccf97d66b131afc0fed80076244fb77b68ad9bf016d9cdc261
MD5 8614d8306ebbb1a4f21f47caca137c1f
BLAKE2b-256 2b31cc5cf31258dc2cbb50dd1b046164add33804eab7af036d86aa68d45c7f6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 76c732905bd84b84d7c6d8b924471a54d02088e649e006ad8abda4b630a5de93
MD5 b88514ef39a2fecb6148a08afb23667b
BLAKE2b-256 88ef777a311a9044fa7b5760848e88b3bbf68d3e535a5a4b813cde839195af51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0fd4c86dbce58bdda149f5175093d50a0396ee5a981675c21b14a30aa667b97f
MD5 2c1ade323798c4e99a6381308e327653
BLAKE2b-256 7c78bc95e29057e80d1da71912426113e85f20752b1031193f51750322354937

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 f4e3d807319e97e406fe76e722a67ec4c20dc2c26f7fea51b66cbb8a5c078eb1
MD5 9f3f957429d9b120b88cba297a6e088d
BLAKE2b-256 16b42aaaf71b87b5cbdbca43862a791fb658cd8eed8a01089a8b3b7bc8f8a975

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.1.15-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.1.15-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 66f35f28b705272f9f54ecb6decb8954d5b0b2db8506cdcf0c0f9b7014b5b446
MD5 070d097db51d7b632bed029b37af5ebc
BLAKE2b-256 e14a7b9821af03b70b45946cf597cfcfc30e3025257fb0c4c350b2e9d693ef7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a875254c00af87e0b9d81026dff165c7233a37672764f0d647a93fd702afa3ef
MD5 04020c614da6288bcb9c8e6f0751dc94
BLAKE2b-256 d063a7284c67b774ee1d879f1a878693c41a0b2f3c7b14e46f51e20b09d5d1e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7fef1125b7a38ce6a839338109de0dfba604552d5ac2f5a839ed1eb5cf8b5887
MD5 62a3a43b0147a11a2901081952d34940
BLAKE2b-256 6000dc52af19fe7b6de0478bbb30f5483ac8b3e831ea7b0730675db90c95db8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 57b73647e25402cfd4ecb42d5bb3ddc5ec740a3124b4559c215c073127971cd5
MD5 3a392d580d81ef2a67870fad3f062472
BLAKE2b-256 8eadb33f9389626709f20c69e6152b886c27e41da16b5c34470481cf609d5a06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ba7571e14f7aca54552dc0ee71714bc4466c5076b571fed2dd6e1af6879a9532
MD5 6c0ab011bc3febc86c92620244622329
BLAKE2b-256 d8d368336aa0f720e4a374f3e212c40e157101ddb03cca6f6c2048f6f6822ef4

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.1.15-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.1.15-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 151d738d479df018edd050ed146567c6044a19b7b7e3d4e38c726e904bad7a3e
MD5 d13a576412eb7406b6bb707add0efc45
BLAKE2b-256 0f52b268c43b96f309221be763a4870a15bd8609e68f60d029e01b37618b9327

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 bb79ef5db35f08bfd340cac25b89eab1dff0d5cbada9015a988d9092e48bbe5c
MD5 068b2ca0fcfd8e4ffb2ecc70f1bd0f09
BLAKE2b-256 65f8df04dc4452fcd24bd9e992de4877cccf80aede76258895279e2cf7d52084

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 049b080c53bc660bce0819cbabeade21bef8cc4f8bd2d4b407e62a576c70ef44
MD5 08f017d55ce5742b86cc5f3d5b656ff0
BLAKE2b-256 ab03c11b77ca5cc075d4ecd20c556328507d0cd6163e47f1b58f83914baf8cd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 02342c264ac95fddd6c5dfdc2bf71bf65617d4b0006b1d56b699b559671f8c9d
MD5 b362e89231229a4f7b3d3845ecc181fb
BLAKE2b-256 adfb6be0d6d58c1d5d1c8cec0c9f7038b56e153924a49ab12059a7218e6fad27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 fc9d2874bfd29dcf238f3d57871d718265573e5e0776980f6eea77409a9ce400
MD5 f26aaf990959d0cd47a7813c3174edba
BLAKE2b-256 c6211469a080ec2c6a16c2291e84ee6007ebe9d2b70d2ea3c43a80d46803db0b

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.1.15-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.1.15-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 856f492631ac5523dd10c8273d8b7ec708199e4a9096deea880a6fc41ffd1bc9
MD5 699d5fceee7a22e805ba118c6bc2dc6c
BLAKE2b-256 b97719b4743352b2e4c0a49e531901b9de5ac66ca64358e6c70e01f58d58cced

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c2cb706934cc55023a2fa597422b4dd18b7bf3cb14033bfe00633b0f16ab9b48
MD5 31f68f3846387df9fca89a61dd171933
BLAKE2b-256 0f8746f41c6673106030d835342e65133085c22cb36549a9ab883bb3cd3f00bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 050202bfcdb4d039dacdb567fe7c04f221f49b59ae5c50c2b111090e2c2451c6
MD5 4cfff7f2264731a7b831fd88d6ff5207
BLAKE2b-256 53dce152c4a5e3f36cc2f916db5e7299c35941975f45ab3c0e2d6500a50f3413

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 e27976369de71b159d4e6cb2599bde860570c82eebd6fe2daaca494e6d3037b5
MD5 1d5af3c84136a8309fff5f091c0b30cb
BLAKE2b-256 98aa4dc81693db941149690381bf030d7caadb5e5dd021ccab58f252893fd728

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 d34fc04624220b0db3652cf52fc40867267a5c92825850ead98da686aea61bb6
MD5 d3d2bd3bff40cccc5fb35c5d6c263ec9
BLAKE2b-256 8da4bb6f467add63dfc8d5f980e5b09ad86d99ce2572b4f99d7f2165f58fe2b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0b75aa8255eea19c3382dad18423a9809873962b1f8488bc7a232dccb847bfc1
MD5 7a7eb5547ca11ef9702041a8fcadc81f
BLAKE2b-256 0e866fc961c5b5f56112f2b35d25e4ffab13aceea02849f9be417749f01ccb1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_python-3.4.1.15-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 22e4b07e30da981a4013141809eb974a6f14cd712fa4fa80f8e70d8cc8c155f8
MD5 113593733a7210cc0b5ba5357d1c635a
BLAKE2b-256 0c630bfca3640ac9e94205dcfc3afbf10075791f7144db2e089d6342346bc928

See more details on using hashes here.

File details

Details for the file opencv_python-3.4.1.15-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.1.15-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 2ed45cfe330c0cbd925c5eb8de32b78fae68ae02952b46bf04af813eefc065b7
MD5 9e86931d5fbab2f9f8485d6c5e89dfe0
BLAKE2b-256 baad3e58023038f9a9e89f452a80fc28a948be97490a57151963d03eb9aece18

See more details on using hashes here.

Supported by

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