Categories
Python Answers

How to automatically create requirements.txt with Python?

Spread the love

Sometimes, we want to automatically create requirements.txt with Python.

In this article, we’ll look at how to automatically create requirements.txt with Python.

How to automatically create requirements.txt with Python?

To automatically create requirements.txt with Python, we can use the pipreqs package.

To install it, we run

pip install pipreqs

Then we create the requirements.txt file for a project with

pipreqs /path/to/project

pipreqs only saves the dependencies required by the project.

Conclusion

To automatically create requirements.txt with Python, we can use the pipreqs package.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *