29

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
kungphu
  • 4,592
  • 3
  • 28
  • 37

2 Answers2

28

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

pip install -q -r requirements.txt

David Schumann
  • 13,380
  • 9
  • 75
  • 96
14

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.

kungphu
  • 4,592
  • 3
  • 28
  • 37
  • 20
    To summarize so others don't have to chase this down, as of today, `pip` will take a `-q` option to quiet installation from requirements files, i.e. `pip -q install -r requirements.txt` - works great! Pip also supports per-line --global-option="..." and --install-option=".." inside the requirements file, depending on whether you want your option to be inserted before or after the 'install' on the setup.py line, e.g. `python install setup.py`. See https://github.com/pypa/pip/pull/2537 – Chris Warth Nov 06 '15 at 20:48