In the process of Python development, often encounter a variety of small problems, such as debugging a good program on a computer, migrating to another machine will often be the project relies on the lack of library to cause errors.
Is there a better way to solve the dependency library package in Python development than to re-install various dependent libraries over and over again? The answer is yes.
JavaScript-like Npm,python also has its powerful package management tool--PIP, which we can use to export dependency in a project:
1 $ pip Freeze > Requirements.txt
Then install dependency with the following command:
1 $ pip Install-r requirements.txt
With these two steps, you can install the required libraries directly when the server is deployed, without waiting for an error to install.
In addition, some small details are worth mentioning, that is, "Pip Freeze > requirements.txt" Directive must be used throughout the project completely run through (that is, the project relies on the complete installation), To write all dependent libraries to the Requirements.txt file, while the "Pip Install-r requirements.txt" directive makes it more suitable for server deployment
Python Export dependent libraries