我想安装statemodel,所以我正在运行
sudo pip install --upgrade -r /srv/requirements.txt
包含requirements.txt
cat requirements.txt
numpy==1.9.0
scipy==0.14.0
patsy==0.3.0
pandas==0.13.0
statsmodels==0.5.0
但看起来pip并没有按顺序安装requirements.txt中列出的软件包 因为我得到依赖性错误,如“statsmodels required scipy”
有没有办法让pip按照他们在requirements.txt中列出的顺序安装软件包?
答案 0 :(得分:3)
您可以使用pip
模块
import pip
with open("requirements.txt") as f:
for line in f:
# call pip's main function with each requirement
pip.main(['install','-U', line])
答案 1 :(得分:0)
cat /srv/requeriments.txt | xargs pip install --upgrade -r