[英]How can I install a github zip file with pip and setup.py from requirements.txt?
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
.我正在使用一个名为
lief
的库,由于它缺乏来自 pip 的完整https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip
3.7 支持,我需要从以下链接安装它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我遇到的问题是,当我执行
pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip
,但是如果我将该链接放在我的 requirements.txt 文件中,它无法在 travis 中安装并出现错误
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.我看到的关于 requirements.txt 和 github 链接的大多数示例都指向提交 hash。 How can I install a github zip file from requirements.txt so when i run
pip install.
如何从 requirements.txt 安装 github zip 文件,所以当我运行
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.
我应该补充一点,如果我执行
pip install -r requirements.txt
,它工作正常,但如果我执行pip install -e.
which uses setup.py, it will fail使用 setup.py,它将失败
As a stop gap measure, I am doing the following in my setup.py
for anyone that runs into a similar problem.作为权宜之计,我在
setup.py
中为遇到类似问题的任何人执行以下操作。 This works with pip install.
这适用于
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.
但真的很想知道是否有更优雅的方式来使用
pip install.
where the link is in requirements.txt
.链接在
requirements.txt
中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.