개발/Server

[Ubuntu 18.04 LTS][Warning] 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.

leebera_ 2022. 3. 6. 18:49

문제점

ubuntu 18.04에선 기본적으로 설치되는 파이썬 버전이 3.6인데 이 버전에서 pip 목록 출력 시 발생한다.

이 버전에서의 pip 목록 출력 방식(legacy)은 deprecation 되어서 언제 사라질 지 모르니 주의하라는 것

deprecation되어 경고가 발생하는 이전 출력 방식(legacy)
바뀐 현재 출력 방식(columns)

 

해결법

홈 디렉터리에 .pip 폴더 생성 후 pip.conf 파일에 아래 내용 작성 후 저장

[list]
format=columns

간단하게 명령어 및 작성 내용만 적으면 아래와 같다.

cd ~
mkdir .pip
nano pip.conf

--- pip.conf 내용
[list]
format=columns
--- 저장 후 닫음

위 명령 수행 및 내용을 작성한 뒤 저장한 후 다시 pip의 목록을 출력하면 현재의 pip 목록 출력 형식으로 보이며 경고가 없어진다.

참고로 이전 방식으로 출력되는 상태에서 경고를 없애고 싶다면 columns 대신 legacy를 입력하면 된다.

 

 


 

참고

 

How to config pip.conf for python2 and python3

When I run pip3 list, I got the message 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....

stackoverflow.com