current position:Home>Upgrade from python2 to python3 (solution for failure to start the pagoda panel)

Upgrade from python2 to python3 (solution for failure to start the pagoda panel)

2022-11-08 09:32:10Deng Dashuai

I. Upgrade Python
yum install python3#Switch to the following directorycd /usr/bin#Back up the original default Python pathmv python python.bak#Link python to python3ln -s python3 python#If the linked command fails, try the following commandln -sf python3 python

Since yum needs to use python2 to run, yum can't be used now:

vim /usr/bin/yumvim /usr/libexec/urlgrabber-ext-down#The top #!/usr/bin/python is modified to #!/usr/bin/python2

Second, the pagoda panel fails to restart after upgrading Python

insert image description here

So delete the previously set soft connectionrm -rf /usr/bin/pythonReset the soft connection of python2 (note the version number of python)ln -s /usr/bin/python2.7 /usr/bin/python

insert image description here
Switch back to python3 afterward:

strong>

#Switch directorycd /usr/bin#Backup the original default Python pathrm -rf /usr/bin/python#Link python to python3ln -s python3 python

insert image description here

nohup python ./sixhn.py &

insert image description here


copyright notice
author[Deng Dashuai],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/312/202211080910333204.html

Random recommended