|
2 | 2 |
|
3 | 3 | ## OpenCV on Wheels
|
4 | 4 |
|
5 |
| -**Unofficial** pre-built OpenCV packages for Python. |
| 5 | +**Unofficial** pre-built CPU-only OpenCV packages for Python. |
| 6 | + |
| 7 | +Check the manual build section if you wish to compile the bindings from source to enable additional modules such as CUDA. |
6 | 8 |
|
7 | 9 | ### Installation and Usage
|
8 | 10 |
|
9 | 11 | 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.
|
10 |
| -2. Select the correct package for your environment: |
| 12 | +2. Make sure that your `pip` version is at minimum 19.3: `pip install --upgrade pip`. Check version with `pip -V`. For example Linux distributions ship usually with very old `pip` versions which cause a lot of unexpected problems expecially with the `manylinux` format. |
| 13 | +3. Select the correct package for your environment: |
11 | 14 |
|
12 |
| - There are four different packages and you should **select only one of them**. Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (`cv2`). If you installed multiple different packages in the same environment, uninstall them all with ``pip uninstall`` and reinstall only one package. |
| 15 | + There are four different packages (see options 1, 2, 3 and 4 below) and you should **SELECT ONLY ONE OF THEM**. Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (`cv2`). If you installed multiple different packages in the same environment, uninstall them all with ``pip uninstall`` and reinstall only one package. |
13 | 16 |
|
14 | 17 | **a.** Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)
|
15 | 18 |
|
16 |
| - - run ``pip install opencv-python`` if you need only main modules |
17 |
| - - run ``pip install opencv-contrib-python`` if you need both main and contrib modules (check extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/)) |
| 19 | + - Option 1 - Main modules package: ``pip install opencv-python`` |
| 20 | + - Option 2 - Full package (contains both main modules and contrib/extra modules): ``pip install opencv-contrib-python`` (check contrib/extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/)) |
18 | 21 |
|
19 |
| - **b.** Packages for server (headless) environments |
| 22 | + **b.** Packages for server (headless) environments (such as Docker, cloud environments etc.) |
20 | 23 |
|
21 |
| - These packages do not contain any GUI functionality. They are smaller and suitable for more restricted environments. |
| 24 | + These packages are smaller than the two other packages above because they do not contain any GUI functionality (not compiled with Qt / other GUI components). This means that the packages avoid a heavy dependency chain to X11 libraries and you will have for example smaller Docker images as a result. You should always use these packages if you do not use `cv2.imshow` et al. or you are using some other package than OpenCV to create your GUI. |
22 | 25 |
|
23 |
| - - run ``pip install opencv-python-headless`` if you need only main modules |
24 |
| - - run ``pip install opencv-contrib-python-headless`` if you need both main and contrib modules (check extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/)) |
| 26 | + - Option 3 - Headless main modules package: ``pip install opencv-python-headless`` |
| 27 | + - Option 4 - Headless full package (contains both main modules and contrib/extra modules): ``pip install opencv-contrib-python-headless`` (check contrib/extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/)) |
25 | 28 |
|
26 |
| -3. Import the package: |
| 29 | +4. Import the package: |
27 | 30 |
|
28 | 31 | ``import cv2``
|
29 | 32 |
|
|
0 commit comments