使用pip install -r requirements.txt 命令批量安裝模塊時,報錯:python
Double requirement given: numpy==1.12.1 from https://files.pythonhosted.org/packages/d8/f9/97aa0903ae39ed4ab6df1c9c22902f3c71f4330a54cf5a81b2bea585544d/numpy-1.12.1-cp27-cp27m-manylinux1_x86_64.whl#sha256=ca917155b35b3bcc68ef1ad82570a29414f5088495ea8f68c65b071c50e64340 (already in numpy==1.9.3 from https://files.pythonhosted.org/packages/f8/63/eca0990ba29244de118489d82ab7511d72cc02bf8ae81ca1aa2a4774d087/numpy-1.9.3-cp27-cp27m-manylinux1_x86_64.whl#sha256=da1563ede37a54c2bd5ab3cb3def94c386f4c7482242cdb7921c22756bbeb461, name='numpy')
從Stack Overflow上查到的解決辦法, 出現這個問題是由於當前安裝的模塊與現有的環境中的模塊衝突,加上這個參數後,能夠禁止構建隔離,參考 https://pip.pypa.io/en/stable/reference/pip/linux
解決辦法:ui
pip install -r requirements.txt --no-build-isolation
把當前環境依賴的模塊,導出到一個文件的命令:pip freeze > requirements.txt
spa