PIPREQS------Find Python project dependencies and generate Requirements.txt

Source: Internet
Author: User
Tags virtualenv

Project development, always to build and deploy the environment, at this time, you need a python third-party package list, commonly called requirements.txt. If the project uses the VIRTUALENV environment, the PIP freeze can be used directly, but if the dependency of the project is not maintained, it will be troublesome, then we need a tool called PIPREQS, which will help us to generate the Requirements.txt file automatically.

Using PIP freeze

$ pip freeze > requirements.txt

This approach works in conjunction with VIRTUALENV, otherwise the entire package is listed in the environment.

Pipreqs

The benefit of this tool is that it is possible to automatically generate dependency manifests by scanning the project directory and automatically discovering the use of those class libraries.

The disadvantage is that there may be some deviations that need to be checked and adjusted yourself.

Usage:

Use PIPREQS in the root directory of the project.

If it is a Windows system, it will report an encoding error (unicodedecodeerror: ' GBK ' codec can ' t decode byte 0xa8 in position 24:illegal multibyte sequence)

When used, specify the encoding format pipreqs./--encoding=utf8

After generating the Requirements.txt file, you can download all dependencies based on this file

Usage: Pip Install-r requriements.txt can

PIPREQS------Find Python project dependencies and generate Requirements.txt

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.