Home:ALL Converter>Specify opencv with CMAKE_ARGS in conda yml

Specify opencv with CMAKE_ARGS in conda yml

Ask Time:2021-04-11T21:18:36         Author:ashnair1

Json Formatter

How can I specify conda (in the environment.yml) to install opencv-contrib-python with pip while specifying CMAKE_ARGS.

Basically, how can I specify conda to run this command in the environment.yml file

CMAKE_ARGS="-DOPENCV_ENABLE_NONFREE=ON" pip install --no-binary=opencv-contrib-python opencv-contrib-python

As it stands if I export the environment via conda env export > environment.yml, it just specifies the version of opencv like so

name: test
channels:
  - conda-forge
  - pkgs/main
  - defaults
dependencies:
  - Bunch of conda dependencies
  - pip:
    - opencv-contrib-python==4.5.1.48
prefix: /home/an/miniconda3/envs/test

Author:ashnair1,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67045434/specify-opencv-with-cmake-args-in-conda-yml
yy