pip fails to install packages from requirements.txt

后端 未结 2 1288
感动是毒
感动是毒 2020-12-01 16:10

I am trying to install a python software using the requirements file.

>> cat requirements.txt
Cython==0.15.1
numpy==1.6.1
distribute==0.6.24
logilab-as         


        
2条回答
  •  北海茫月
    2020-12-01 16:47

    I come across with a similar issue and I ended up with the below:

    cat requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 python -m pip install
    

    That will read line by line the requirements.txt and execute pip. I cannot find from where I got the answer properly, so apologies for that, but I found some justification below:

    1. How sed works: https://howto.lintel.in/truncate-empty-lines-using-sed/
    2. Another similar answer but with git: https://stackoverflow.com/a/46494462/7127519

    Hope this help with alternatives.

提交回复
热议问题