Pip freeze for only project requirements
I just had the same issue, here's what I've found to solve the problem.
First create the venv in the directory of your project, then activate it.
For Linux/MacOS : python3 -m venv ./venv source myvenv/bin/activate
For Windows :  python3 -m venv .\venv env\Scripts\activate.bat
Now pip freeze > requirements.txt should only takes the library used in the project.
NB: If you have already begin your project you will have to reinstall all the library to have them in pip freeze.
When I run pip freeze > requirements.txt it seems to include all installed packages. This appears to be the documented behavior.
I have, however, done something wrong as this now includes things like Django in projects that have no business with Django.
How do I get requirements for just this project? or in the future how do I install a package with pip to be used for this project. I think I missed something about a virtualenv.