Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide "Requirement already satisfied" warning

Tags:

pip

We have a shell script that automatically prepares virtual environment and then runs tests in it. Part of the script installs requirements:

pip install -r requirements.txt

When the script is run multiple times it prints a warning for each requirement:

Requirement already satisfied (use --upgrade to upgrade): discover==0.4.0
...

I need to run the installation step every time in case that someone adds a new requirement. I understand why the warning is displayed. The problem is that it clutters the test output.

Is there a way how to disable/hide this warning?

like image 318
Prvaak Avatar asked Mar 12 '23 18:03

Prvaak


1 Answers

It worked for me:

pip install -r requirements.txt | grep -v 'already satisfied'

like image 135
p3quod Avatar answered Apr 07 '23 17:04

p3quod