3

I am working with a library called lief which due to it lacking full python 3.7 support from pip, I need to install it from the following link https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip.

The issue I am having is that it works fine when i do pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip, it works fine, but if i put that link in my requirements.txt file, it fails to install in travis with the error

error in rapido setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at "'://githu'"

Most of the examples I have seen about requirements.txt and github link points to a commit hash. How can I install a github zip file from requirements.txt so when i run pip install ., I am not getting the above mentioned error?

I should add that if i do pip install -r requirements.txt, it works fine, but if i do pip install -e . which uses setup.py, it will fail

securisec
  • 3,435
  • 6
  • 36
  • 63
  • Can u try like this in req. txt file . `git+https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip` – Syed Jafer Sep 19 '19 at 04:26
  • No, that only works if i do `-r requirements.txt`. That is not the question being asked here. – securisec Sep 19 '19 at 04:35
  • Possible duplicate of [How to state in requirements.txt a direct github source](https://stackoverflow.com/questions/16584552/how-to-state-in-requirements-txt-a-direct-github-source) – FlyingTeller Sep 19 '19 at 08:33
  • Edit your question to show what you actually have: your `setup.py`, your `requirements.txt`, and anything else that might be relevant. – sinoroc Sep 19 '19 at 09:12
  • @FlyingTeller not a duplicate because those are asking about `.git` links, or release tags, not a zip file. – securisec Sep 19 '19 at 13:47

1 Answers1

2

As a stop gap measure, I am doing the following in my setup.py for anyone that runs into a similar problem. This works with pip install .

from pip._internal import main as pipmain
pipmain(['install', 'https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip'])

But would really like to know if there is a more elegant way to do this using pip install . where the link is in requirements.txt.

securisec
  • 3,435
  • 6
  • 36
  • 63