python - pip 不会安装我的包的依赖项

标签 python git pip setup.py

我正在使用 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/

相关文章:

python - pip找不到opencv

自系统更新以来 python3 pip 损坏

python - 在 DataFrame pandas 中添加日期之间的天数列

python - Python 中的字符串格式检查

python - 将 dict 转换为 pandas DataFrame

linux - Nginx 默认配置目录

Python3 pip3 无法安装requests

python - 多个返回函数构造函数参数

推送到远程时 git push 卡住了

git - 在不 merge 的情况下使用 master 更新 git 分支