您可以导出没有环境变量的 conda env 吗?

Can you export a conda env without environment variables?

Conda 4.9 添加了在 yml 文件中设置和导出环境变量的功能,如文档所示:https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#setting-environment-variables

但是,有时我想导出一个 environment.yml 文件并隐藏环境变量,因为 yml 文件将在 public 存储库中。变量是否每次都需要从 yml 文件中手动删除,或者是否有我缺少的标志?

conda env export 的文档说没有排除环境变量的标志。但是你可以使用

--no-builds
Remove build specification from dependencies

--ignore-channels
Do not include channel names with package names.