4

I've got URL similar tohttps://github.com/me/my-project/archive/master.zip

During development, I was able to install it with:

pip install https://github.com/me/my-project/archive/master.zip

How would I go about adding that to requirements.txt? I can only see options for repositories.

Thanks.

E. Edwards
  • 368
  • 2
  • 12
  • 1
    You call look into this too [python packaging](https://python-packaging.readthedocs.io/en/latest/dependencies.html#packages-not-on-pypi) – Shan-Desai Mar 18 '19 at 11:02

4 Answers4

3

I found out! This needs to be added to requirements.txt:

-e git+https://github.com/me/my-project/#egg=my-project

Previously I was using a different VCS tag which was giving me some funky errors.

E. Edwards
  • 368
  • 2
  • 12
0

The accepted answer didn't work for me only because the package I am using needs to be installed directly from a zip that's been downloaded from github.

But, this worked for me:

from pip._internal import main as pipmain
pipmain(['install', 'package-downloaded-from-github-master.zip'])

Which I got from here: How can I install a github zip file with pip and setup.py from requirements.txt?

ChrisDanger
  • 1,071
  • 11
  • 10
0

Without third-party dependencies out of the box, you can do this by simply adding the following line to requirements.txt:

my-project @ https://github.com/me/my-project/archive/master.zip
-2

Not sure how to achive this via Pip

I can suggest, if you aren't able to find any solutions this way, to use pipenv.

Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. Windows is a first-class citizen, in our world.
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages. It also generates the ever-important Pipfile.lock, which is used to produce deterministic builds.

Pipenv on Github: https://github.com/pypa/pipenv

Hope it helps
Hele

Hele
  • 189
  • 1
  • 12