问题:
I am installing packages from requirements.txt
我正在从requirements.txt
安装软件包
pip install -r requirements.txt
The requirements.txt
file reads: requirements.txt
文件内容如下:
Pillow
lxml
cssselect
jieba
beautifulsoup
nltk
lxml
is the only package failing to install and this leads to everything failing (expected results as pointed out by larsks in the comments). lxml
是唯一一个安装失败的包,这会导致一切都失败(如 larsks 在评论中指出的预期结果)。 However, after lxml
fails pip
still runs through and downloads the rest of the packages.但是,在lxml
失败后, pip
仍然运行并下载其余的包。
From what I understand the pip install -r requirements.txt
command will fail if any of the packages listed in the requirements.txt
fail to install.据我了解,如果requirements.txt
列出的任何软件包无法pip install -r requirements.txt
, pip install -r requirements.txt
命令将失败。
Is there any argument I can pass when running pip install -r requirements.txt
to tell it to install what it can and skip the packages that it cannot, or to exit as soon as it sees something fail?在运行pip install -r requirements.txt
时我是否可以通过任何参数来告诉它安装它可以安装的东西并跳过它不能安装的包,或者在它看到某些失败时立即退出?
解决方案:
参考一: https://en.stackoom.com/question/1VMMl参考二: https://stackoom.com/question/1VMMl