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