简体   繁体   English

如何安装 github zip 文件与 pip 和 setup.py 来自 requirements.txt?

[英]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.

相关问题 Requirements.txt中私人git信息库的路径-如何使其与手动setup.py安装一起使用? - Path to private git repository in requirements.txt - how can I make it work with manual setup.py install? setup.py&pip:覆盖requirements.txt中依赖项的子依赖项之一 - setup.py & pip: override one of the dependency's sub-dependency from requirements.txt 如何根据本地目录中的 requirements.txt 文件使用 pip 安装软件包? - How can I install packages using pip according to the requirements.txt file from a local directory? requirements.txt 与 setup.py - requirements.txt vs setup.py Setup.py 从 requirements.txt 跳过开发依赖 - Setup.py skip dev dependency from requirements.txt setuptools setup.py 文件中 install_requires kwarg 的参考 requirements.txt - Reference requirements.txt for the install_requires kwarg in setuptools setup.py file 结构化setup.py和requirements.txt,以便正确安装pip - Structuring setup.py and requirements.txt so that pip installs properly 使用 setup.py 和 requirements.txt 用 github 版本覆盖 package? - Using setup.py and requirements.txt to overwrite package with a github version? 为什么使用点“.”从 setup.py 安装 `install_requires` 在 Dockerfile 中的 requirements.txt 失败? - Why does installing `install_requires` from setup.py using a dot “.” in the requirements.txt fail in Dockerfile? pip3 install -r requirements.txt - 命令“python setup.py egg_info”失败,错误代码1在/ private / tmp / pip-build-a0nd7us1 / post / - pip3 install -r requirements.txt - Command “python setup.py egg_info” failed with error code 1 in /private/tmp/pip-build-a0nd7us1/post/
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM