I would like to export the conda environment configuration file using the conda.cli python package, similar to what is done here for installing a package.
So far I've tried using this code snippet:
import conda.cli
conda.cli.main('conda','env','export','-f','env.yml')
However, it produces the following error:
usage: conda-env [-h] {attach,create,export,list,remove,upload,update} ...
conda-env: error: invalid choice: 'C:\\Users\\xxxx\\AppData\\Roaming\\jupyter\\runtime\\kernel-8284.json' (choose from 'attach', 'create', 'export', 'list', 'remove', 'upload', 'update')