반응형
unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu
관련 포스팅.
1번 답변 (246 upvote):
From the comment:
sudo update-alternatives --config python
Will show you an error:
update-alternatives: error: no alternatives for python3
You need to update your update-alternatives , then you will be able to set your default python version.
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
Then run :
sudo update-alternatives --config python
Set python3.6 as default.
Or use the following command to set python3.6 as default:
sudo update-alternatives --set python /usr/bin/python3.6
2번 답변 : (37 upvote)
You can achieve this by applying below simple steps -
- Check python version on terminal - python --version
- Get root user privileges. On terminal type - sudo su
- Write down the root user password
- Execute this command to switch to python 3.6 -
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 - Check python version - python --version
- Done.
반응형
'Linux > Ubuntu' 카테고리의 다른 글
SFTP 사용법과 사용하는 이유 (0) | 2020.12.18 |
---|---|
linux log 생성하기 (0) | 2020.12.08 |
Ubuntu cli mode로 시작하기 (0) | 2020.11.23 |
Ubuntu 메모리, 저장공간 확인 (0) | 2020.10.22 |
Ubuntu 18.04에서 tensorflow 설치하기 (Nvidia Jetson Tx2, wheel) (0) | 2020.10.19 |