Python Export dependent libraries

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.