본문 바로가기
카테고리 없음

[python/파이썬 기초] python 버전 default 지정

by Hyper하이퍼 2024. 2. 3.
반응형

python버전_python특정버전지정_python특정버전_python기초

 

안녕하세요.

오늘은 PC내 여러 python 번전 중 특정 버전을 default로 지정하는 방법에 대해서 공유드리겠습니다.

반응형

1. python default 버전 확인

ls -alith /usr/bin/python3

<출력 결과>
xxxxxx lrwxrwxrex 1 root root 9 jul 19 2021 /usr/bin/python3 -> python3.8

 

2. python3 설치 위치 확인

$ python3 -V
Python 3.8.10

$ which python3.8
/usr/bin/python3.8

$ which python3.9
/usr/bin/python3.9

 

3. default 변경

$ sudo update-alternatives --config python3

There are 2 choices for the alternative python3 (providing /usr/bin/python3)

해당하는 버전을 선택 후 Enter

 

 

반응형