한 번만 더 해보자

[Linux] 파이썬 버전 업그레이드 본문

Linux

[Linux] 파이썬 버전 업그레이드

정 하임 2023. 9. 3. 20:45

상황

파이썬 3.8 이상이 필요한데 현재 깔린 버전은 3.6이다

python python3 둘 다 3.6버전이 나옴

해결방안

$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in auto mode


$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
update-alternatives: using /usr/bin/python3.8 to provide /usr/bin/python3 (python3) in auto mode


$ update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3.8   2         auto mode
  1            /usr/bin/python3.6   1         manual mode
  2            /usr/bin/python3.8   2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 2


$ python -V
Python 3.8.0


$ python3 -V
Python 3.8.0
반응형

'Linux' 카테고리의 다른 글

E: Unable to locate package  (0) 2023.09.10
[Linux] 문자열 검색  (0) 2023.09.10
[Linux] permission denied  (0) 2023.09.03
[docker] 도커 설명  (3) 2023.05.16
[Linux] 리눅스 가상환경 생성 및 yolo v7 설치  (0) 2023.02.28