pip list警告解决
问题描述:
•我们第一次在Linux中查看我们python安装的库时,就会出现以下警告,但不影响正常查看结果,只是不美观。
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
•问题原因:pip升级到9.0.1后以及更高版本, 查看pip list 就会出现上述警告 , 警告提示pip的高版本默认输出格式会采用columns, 你可以通过 --format来指定以什么形式进行展示输出结果(legacyh格式 或者 columns 格式)
解决方法:
创建pip.conf
配置文件
•首先,进入根目录
cd ~
•如下图,创建隐藏 .pip目录
mkdir .pip
•进入隐藏目录 .pip
cd .pip
•创建pip.conf文件
并编写配置内容
vim pip.conf
•写入下面内容,即可完成配置
[list]
format = columns
•上面所有步骤完成即可解决警告问题
查看结果:
•回到根目录,使用pip list
查看是否解决问题