Why would you create a requirements.txt file in a Python virtual environment?
As long as it is technically possible, I find no reason for this. Having both is confusing because it is unclear which one is the "boss". And you should (or shouldn't?) Worry about consistency between the installed packages and the requirements.txt file.
Also venv and installed packages are in many cases dependent on the underlying OS, they have binaries, different layouts, etc. It is generally recommended to write os-independent code.
In general, I would stick with the requirements .txt file and remove any venv folder from the project repo.
source to share
You cannot distribute the virtualenv directory in your project because the content may differ depending on the target operating system and operating system version. In particular, virtualenv, which includes libraries with compiled components installed on Ubuntu 14.04, will differ from the equivalent virtualenv installed on Ubuntu 16.04.
Instead, you must distribute your requirements.txt
file (just a convention, you can use any filename you want) so that the end user can recreate the virtualenv on their machine.
source to share