Description
What to if a Python project does not have requirements.txt file
Resolution
Python without requirements.txt
If your project doesn’t have a requirements.txt file, this is an article on how to create one from the project: https://learnpython.com/blog/python-requirements-file/
According to the article, you can generate the file with the pip freeze command, like:
- • pip freeze > requirements.txt
- • pip freeze doc: https://pip.pypa.io/en/stable/cli/pip_freeze/
The article also mentions pipreqs (https://github.com/bndr/pipreqs) to create the requirements.txt.
And here’s an article on why NOT to use pip freeze: https://builtin.com/software-engineering-perspectives/pip-freeze
Which also recommends using https://github.com/bndr/pipreqs instead of pip freeze. In the description of this project, it shows the benefits over pip freeze.