Handling Direct GitHub Sources in Requirements.txt
In order to install dependencies directly from a GitHub repository, you may have encountered difficulties with the syntax in requirements.txt files.
Unlike regular package specifications (package-name==version), specifying a GitHub source requires a different approach:
Correct Syntax:
To reference a GitHub repo in requirements.txt, omit the package-name==version format. Instead, use the following structure:
package @ git+https://github.com/owner/repo@[specifier]
where [specifier] can be:
Examples:
Note:
In earlier versions of pip, you may need to update the package version in its setup.py to prevent pip from assuming the requirement is already satisfied.
The above is the detailed content of How to Specify GitHub Sources in Your requirements.txt?. For more information, please follow other related articles on the PHP Chinese website!