On linux, you can use the following operations
while read requirement; do sudo pip install $requirement; done < requirement.txt
Write a script on windows
import sys
from pip._internal import main as pip_main
def install(package):
pip_main(['--default-timeout=1000','install','-U', package])
if __name__=='__main__':
with open(sys.argv[1],'rb') as f:
for line in f:
install(line)
Note that the path in the code command must correspond to your own file path.