Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quiet output from pip via requirements file?

pip has a -q/--quiet flag that works ideally from the command line. I'm using an automated deployment process (Amazon Elastic Beanstalk), and the tools use pip to install from a requirements file.

Unfortunately, pip is generating non-error output that's causing EB to abort due to its logger being unable to handle non-ASCII output.

Since I can't apply the quiet flag to the pip command directly (it's run automatically), is there a per-line flag I can set in my requirements file or an environment variable that would suppress pip's output?

like image 959
kungphu Avatar asked Jan 31 '13 01:01

kungphu


People also ask

Can I put pip in requirements txt?

If you are managing Python packages (libraries) with pip, you can use the configuration file requirements. txt to install the specified packages with the specified version.

How do I install pip packages from requirements txt?

Use the pip install -r requirements. txt command to install all of the Python modules and packages listed in your requirements. txt file.

What does pip install R requirements txt means?

In your case pip install -r requirements. txt will install the libraries listed in your requirements.


2 Answers

Pip offers the --quiet / -q option to silence output. Example:

pip install -q -r requirements.txt

like image 71
David Schumann Avatar answered Oct 02 '22 14:10

David Schumann


After more digging, this is a pending feature request for pip in github:

https://github.com/pypa/pip/issues/271

Temporary workaround: Using a separate bash script to invoke pip per-line until this is implemented, published, and available on Elastic Beanstalk.

like image 20
kungphu Avatar answered Oct 02 '22 14:10

kungphu