How to state in requirements.txt a direct github source
Normally your requirements.txt
file would look something like this:
package-one==1.9.4
package-two==3.7.1
package-three==1.0.1
...
To specify a Github repo, you do not need the package-name==
convention.
The examples below update package-two
using a GitHub repo. The text between @
and #
denotes the specifics of the package.
Specify commit hash (41b95ec
in the context of updated requirements.txt
):
package-one==1.9.4
git+https://github.com/path/to/package-two@41b95ec#egg=package-two
package-three==1.0.1
Specify branch name (master
):
git+https://github.com/path/to/package-two@master#egg=package-two
Specify tag (0.1
):
git+https://github.com/path/to/package-two@0.1#egg=package-two
Specify release (3.7.1
):
git+https://github.com/path/to/package-two@releases/tag/v3.7.1#egg=package-two
Note that #egg=package-two
is not a comment here, it is to explicitly state the package name
This blog post has some more discussion on the topic.
pip install via requirements.txt specify a direct GitHub private repo + branch name erroring with exit status 128
I figured out my problem in both cases... syntax
Attempt #1
Mistake: needed to say git@github.com
Correct method:
-e git+ssh://git@github.com/Organization/repo-name.git@branch/name#egg=foo
Attempt #2
Mistake: didn't know one can use @
twice
Correct method:
-e git+git@github.com:Organization/repo-name.git@branch/name#egg=foo
Downloading requirements.txt from GitHub
pip install -r https://raw.githubusercontent.com/GabrielCoutz/Problema-Chiado/main/requirements.txt
-e is for local installs for developing, for example. Check this:
What is the use case for `pip install -e`?
Related Topics
Convert JSON String to Dict Using Python
How to Check If All Elements of a List Match a Condition
Determining Application Path in a Python Exe Generated by Pyinstaller
Writing Unicode Text to a Text File
Is There a List of Pytz Timezones
How to Get Attribute of Element from Selenium
In Tkinter How to Make a Widget Invisible
How to Speed Up Bulk Insert to Ms SQL Server Using Pyodbc
Max Retries Exceeded with Url in Requests
How to Remove Relative Shift in Matplotlib Axis
How to Use Xpath with Beautifulsoup
Replace Console Output in Python
Plot Logarithmic Axes with Matplotlib in Python
Good Python Modules for Fuzzy String Comparison
Confused About Backslashes in Regular Expressions