How to freeze packages installed only in the virtual environment, that is, without the global ones?
You need to use the -l or --local option to freeze only the local packages (and not the global ones)
-l
--local
pip freeze -l > requirements.txt
Make sure you are working in the virtualenv before doing pip freeze -l.
virtualenv
pip freeze -l