Create pip.conf and remove the pip list warning

Money and Business

I updated pip to 9.0.1 and now I get a warning message in the pip list command.

DEPRECATION: The default format will switch to columns in the future. You can use –format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

As the message says, if you add the option to specify the format as follows, there will be no warning.
pip list --format=columns
However, it is too much trouble to add it every time, so add it to the following configuration file.

  • pip.conf (Unix, macOS)
  • pip.ini(Windows)
  • Location of the pip configuration filepip.conf,pip.ini
  • pip.conf,pip.iniWhat to add to the file

Location of the pip.conf and pip.ini configuration files

The location of the pip configuration file pip.conf (pip.ini on Windows) is as follows. If the configuration file does not exist, create a new one.

It depends on Unix, macOS, and Windows.

  • Unix
    • $HOME/.config/pip/pip.conf
    • legacy:$HOME/.pip/pip.conf
    • virtualenv:$VIRTUAL_ENV/pip.conf
  • macOS
    • $HOME/Library/Application Support/pip/pip.conf
    • legacy:$HOME/.pip/pip.conf
    • virtualenv:$VIRTUAL_ENV/pip.conf
  • Windows
    • %APPDATA%\pip\pip.ini
    • legacy:%HOME%\pip\pip.ini
    • virtualenv:%VIRTUAL_ENV%\pip.ini

What to add to pip.conf and pip.ini

Add the following to the configuration file.

[list]
format = <list_format>

There are four choices for <list_format>.

  • legacy
  • columns
  • freeze
  • json

Choose the one you like.

legacy

Display as before.

colorama (0.3.7)
docopt (0.6.2)
idlex (1.13)
jedi (0.9.0)

columns

Package Version
--------- -------
colorama  0.3.7
docopt    0.6.2
idlex     1.13
jedi      0.9.0

freeze

colorama==0.3.7
docopt==0.6.2
idlex==1.13
jedi==0.9.0

json

[{'name': 'colorama', 'version': '0.3.7'}, {'name': 'docopt', 'version': '0.6.2'}, ...
Copied title and URL