問題:
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