"conda create requirements.txt" Code Answer’s
Conda:
In Anacona python packages, dependency and environment are managed by a tool which is known as Conda. It is broadly used in the development of those projects in which it is difficult to install the binary extension.
If you want to install all the packages in the requirements.txt file Conda may be used. You may save it from the old environment or may install a new one.
Follow the following commands to create requirments.txt via Conda:
create requirements.txt conda
pip freeze > requirements.txt
# OR
conda list -e > requirements.txt
conda create environment based on requirements.txt
# using pip
pip install -r requirements.txt
# using Conda
conda create --name <env_name> --file requirements.txt
output requirements conda
conda activate <env>
conda install pip
pip freeze > requirements.txt
Note:
when you will generate a new Conda environment using the command Conda create --name my_project_env , it will not install pip automatically. You have to install it manually through the command pip install -r requirements.txt.
Keep in mind that this will create all requirements to the python path globally rather than installing in the environment.