0
我使用pip install git+http://github.com/myuser/myrepo.git#egg=myrepo
(當然是在virtualenv中)來安裝我正在使用的軟件包,而我的git軟件倉庫有requirements.txt
,但pip不會安裝它的依賴關係。有沒有辦法使這項工作與我在PyPI中使用pip時類似,這樣我的依賴將自動安裝?pip不會安裝我的軟件包的依賴關係
我使用pip install git+http://github.com/myuser/myrepo.git#egg=myrepo
(當然是在virtualenv中)來安裝我正在使用的軟件包,而我的git軟件倉庫有requirements.txt
,但pip不會安裝它的依賴關係。有沒有辦法使這項工作與我在PyPI中使用pip時類似,這樣我的依賴將自動安裝?pip不會安裝我的軟件包的依賴關係
從我的理解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?
你可以用'PIP安裝-r要求.txt' –
pip不會隱式處理任何requirements.txt。但是,如果您將setup添加到setup.py中 - 即使從git安裝包時也會安裝它們。 – iced