Conda env export

Hello!! I recently started using Jupyter notebook and I am stuck trying to solve this:

I am running conda 3.9, and I would like to execute the command conda env export to report all the dependencies that are currently being used in the environment in my Jupyter book.

When I run this code cell from the browser it shows properly the dependencies as desired but when I build the book using **jupyter-book build **, looks like it does not executes anything.

How about running it without the ! magic, e.g.

subrocess.call(["conda", "env", "export"])

sometimes magics get funny when not run under “real” interactive kernels…

Hello bollwyvl!

First things first, thank you for answering me, I have also tried with the following:
conda env export (without !), same result.

and also:
import subprocess
a = subprocess.Popen(“conda env export”, shell=True, stdout=subprocess.PIPE)
print(a.stdout.read().decode())

Each one of this solutions, works and show the dependencies during the notebook edit, but nothing is executed when building the book.

Best regards