Ubuntu 명령어 우선순위 변경 (Python3)
1
2
3
python
-bash: /usr/bin/python: No such file or directory
Alternatives
- Python3 위치 파악
1 2 3
which python3 /usr/bin/python3
- python의 alternatives 파악
1 2 3
sudo update-alternatives --config python update-alternatives: error: no alternatives for python
- 명령어 우선순위 등록
1 2 3
# update-alternatives --install [SYMBOLIC_PATH] [ALTER_NAME] [REAL_PATH] [NUMBER] sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2 # if python2 exists
- 명령어 확인
1
sudo update-alternatives --config python
Alternatives 제거
1
2
# sudo update-alternatives --remove [ALTER_NAME] [REAL_PATH]
sudo update-alternatives --remove python /usr/bin/python3