pip freeze > requirements.txt # OR conda list -e > requirements.txt
Here is what the above code is Doing:
1. It’s creating a requirements.txt file in the current directory.
2. It’s populating the requirements.txt file with the list of packages and their versions.
3. It’s using the > character to write output to a file.