And switching the linux python2 to python3 (rpm)

Using the update-alternatives switch channels

1. Open a terminal: Ctrl + Alt + T
2. Check the help update-alternatives: update-alternatives --help
3. see if there python options: update-alternatives --display python
4. If not, enter the following command to establish python options

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1

5. Switch python version:

sudo update-alternatives --config python

6. want to delete an option:sudo update-alternatives --remove python /usr/bin/python2.7

7. Reference Links: https://www.cnblogs.com/zl1991/p/9041554.html

Guess you like

Origin blog.csdn.net/dxyinme/article/details/94596997