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.
Mac电脑,找不到pip.conf,使用pip list | grep torch --format=(legacy|columns)报错时的解决方案。
cd 到pip所在的文件夹下(我这里是/Users/name/opt/anaconda3/envs/nlp/bin):
touch pip.ini
vim pip.ini
输入i进行insert
[list]
format=columns
esc退出,输入
:wq
再使用
pip list | grep torch
正常输出
torch 1.5.1
torchtext 0.6.0
torchvision 0.6.1
刚才翻了一下ubuntu18.04下在使用pip list时出现DEPRECATION,发现–format是这样用的
pip list --format=legacy
pip list --format=columns