Create the virtual environment ‘conda env create — name venvname’
Then use the ‘conda install’ to install the required packages.
Use ‘conda env export — name <venvname> > environment.yaml
Trick: The auto-generated the YAML file is very verbose, can be significantly simplified manually to only explicitly include what’s required, such as numpy/matplotlib/OpenCV.
Then other people can use ‘conda env create — file environment.yaml” to create the same python environment.
Use ‘conda activate venvname’ to activate this virtual environment and then run your python program.