So the issue I had was that my actual workspace was:
MyProject |- .venv // <- My Python Virtual Environment |- test.py My Python Virtual Environment was in my Project folder so when I run the command
pipreqs ./ it is looking at all the dependencies of all the files in the folder (including my virtual environment) and that is why it was generating a weird requirements.txt file.
To fix this, I used the option --ignore of pipreqs:
pipreqs ./ --ignore .venv And the generated requirements.txt is:
selenium==3.141.0 You may also want to ignore other folders that are causing issues like this:
pipreqs --ignore bin,etc,include,lib,lib64,.venv The --force tag will also overwrite the existing requirements.txt