How to generate a environments.yml file of a Python virtual environment?

Viewed 1005

I want to generate a environments.yml file of an existing Python environment. I tried the following command:

python env export --from-history -f environment.yml

This throws the following error:

can't open file 'env': [Errno 2] No such file or directory

Note: This is not a conda environment.

2 Answers

Are you looking for:

conda env export > environment.yml

pip freeze > requirements.txt to save the venv

pip install -r requirements.txt to create venv.

Related