0

I have Requirments.txt file where I have written all the packages I want to install, each package on new line.

like :

!pip install torch \
!pip install torchvision\
and etc...

How To loop over the file and install each package with for loop in python ?

Thanks.

tornike
  • 27
  • 4
  • Should ```!, \``` be stripped? –  Aug 24 '21 at 05:32
  • 2
    This is not how `requirements.txt` works. You should have only listed the package names and `pip -r requirements.txt` will install them all. See the documentation for the correct usage. – Selcuk Aug 24 '21 at 05:34
  • @Selcuk For this example `pip install -r requirements.txt` will not work. pip can identify `!pip install torch \` as installation package. – Sabil Aug 24 '21 at 06:15
  • Read my comment and the duplicate question once more please. – Selcuk Aug 24 '21 at 07:15

0 Answers0