How to reproduce a environment using an 'environemt.yaml' file?

Using the Conda command ‘conda env export - f env. yaml’ to export the configuration file of a certain environment, and then using ‘conda env create - n dstenv - f env. yaml’ to reproduce the environment, there are often problems where some third-party libraries cannot be found or some libraries conflict with each other. Therefore, using the above command to reproduce an environment has almost never been successful, but these problems have not occurred in the original environment.
My question is how to output a correct YAML file to reproduce the environment.

Hey @realleewq! Thanks for posting your question here.

Did you look into conda-pack tool?
" conda-pack is a command line tool for creating archives of conda environments that can be installed on other systems and locations."

Hope this helps!