我正在使用 pip install git+http://github.com/myuser/myrepo.git#egg=myrepo
(当然是在 virtualenv 中)来安装我正在安装的包正在处理,我的 git 存储库有一个 requirements.txt
,但 pip 不会安装它的依赖项。有没有一种方法可以使这项工作类似于我将 pip 与 PyPI 中的包一起使用时的情况,以便自动安装我的依赖项?
最佳答案
据我了解,pip 仅安装 setup.py 中指定的依赖项。
但是,如果您更喜欢使用需求来保留所有依赖项,则可以通过以下方式在 setup.py 中包含需求:
import os
from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(...
install_requires=required,
...)
代码复制自:Reference requirements.txt for the install_requires kwarg in setuptools setup.py file?
关于python - pip 不会安装我的包的依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36963563/