Current location - Quotes Website - Signature design - Python dependency library libcrypto help
Python dependency library libcrypto help
During the development of Python, we often encounter various minor problems. For example, when a program debugged on one computer is migrated to another computer, it often leads to errors due to the lack of project dependency libraries.

Is there a better way to solve the packaging problem of dependency libraries besides reinstalling various related dependency libraries in Python development in order to deal with errors thrown again and again? The answer is yes.

Similar to npm of JavaScript, Python also has its powerful package management tool-PIP, and we can use PIP to export the dependencies in the project:

1 $ pip freeze & gtrequirements.txt

Then install the dependency by the following command:

1 $ pip installation requirements. txt

After the above two steps, you can directly install the required dependency libraries when deploying the server, instead of installing them one by one after reporting the error.

In addition, there are some small details worth mentioning, that is, the "pipfreeze >" requirements. txt instruction must be used when the whole project has been completely penetrated (that is, all project dependencies have been installed), so that all related dependency libraries can be written into the requirements. txt file, and the "pip install -r requirements.txt" instruction is more suitable for server deployment.