sukhi
sukhi

Reputation: 73

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

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.

Upvotes: 5

Views: 7714

Answers (2)

nikeros
nikeros

Reputation: 3379

Are you looking for:

conda env export > environment.yml

Upvotes: 6

Anu
Anu

Reputation: 436

pip freeze > requirements.txt to save the venv

pip install -r requirements.txt to create venv.

Upvotes: 1

Related Questions