简体   繁体   English

Jupyter Notebook 将 env yml 打印为单元格 output 而不保存到文件

[英]Jupyter Notebook print env yml as cell output without saving to file

How can I print my environment yaml to an output cell in a Jupyter notebook without creating the actual file?如何在不创建实际文件的情况下将我的环境 yaml 打印到 Jupyter 笔记本中的 output 单元格?

Desired output:所需的 output:

在此处输入图像描述

If you don't have an environment file you can call the conda command in the jupyter notebook and run it using the shell with:如果您没有环境文件,您可以在 jupyter notebook 中调用 conda 命令并使用 shell 运行它:

! conda env export --from-history

The --from-history option will ensure your output is just the packages you've installed via conda . --from --from-history选项将确保您的 output 只是您通过 conda 安装的软件包 The full specification can be retrieved with:可以通过以下方式检索完整的规范:

! conda env export

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM