Stop pip from failing on single package when installing with requirements.txt

问题:

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.txtpip 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章