Recently learned Python in the requirements.txt, perhaps because it is too simple, the online did not search for a more complete introduction, so this article mainly introduced about Python requirements.txt related information, the need for friends can refer to the following to see it together.
Brief introduction
A Python project must contain a requirements.txt file that records all dependent packages and their exact version numbers. For new environments to be deployed.
The main wording is as follows
Pip freeze > Requirements.txt # Generate Requirements.txtpip install-r requirements.txt # dependencies from Requirements.txt installation
Supported notation
-R base.txt # base.txt all packages below pypinyin==0.12.0 # specified version (most everyday notation) django-querycount>=0.5.0 # is greater than a version Django-debug-toolbar >=1.3.1,<=1.3.3 # Version Range Ipython # default (there is no replacement, there is no install the latest version)
Third-party tool generation
Pip freeze comes with some packages that are not needed, as well as packages that are dependent on some packages ~
Pipreqs automatically analyzes the packages referenced in the project. When the Django project was built automatically, the MySQL package was ignored, and the version was strange, and when the Internet search encountered 404, the error jumped.