It is quite common to use requirements.txt to specify the python package requirements for the project. What is usually done is

pip install -r requirements.txt

When we create a new conda environment using

conda create --name my_project_env

pip is not installed by default. However, pip is usually installed on a user level, which mean you could actually run the command

pip install -r requirements.txt

in this environment. But this will install all requirements to the python path globally instead of in the environment.

To install requirements.txt in the environment, we have to use the pip installed within the environment. Thus we should install pip first by

conda install pip

Then we can install the requirements.txt.

Of course, there is a better way. We simply create a conda environment with pip installed in it:

conda create -n yourenv pip