Wechseln Sie wieder zu Python 2.7
Verwenden Sie den Befehl:
sudo update-alternatives --config python
Wenn Sie einen Fehler erhalten:
update-alternatives: error: no alternatives for python
Aktualisieren Sie Ihr update-alternatives
wie folgt:
ls /usr/bin | grep python | columns
Beispielausgabe:
dh_python2 idle-python3.4 python2 python3 python3.4m dh_python3 python python2.7 python3.4 python3m
Du hast die python2.7
und python3.4
, laufe:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2
Sehen update-alternatives --help
Jetzt kannst du laufen.
sudo update-alternatives --config python
Beispielausgabe:
There are 2 choices for the alternative python (providing /usr/bin/python). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/python3.4 2 auto mode 1 /usr/bin/python2.7 1 manual mode 2 /usr/bin/python3.4 2 manual mode Press enter to keep the current choice[*], or type selection number: 1
Um den python2.7
Standardwert festzulegen, wählen Sie 1
Lauf :
sudo dpkg --configure -a sudo apt update
Verwenden Sie den Befehl history
, um das zuletzt installierte *-python
Paket abzurufen, das Ihr System beschädigt (z. B.; python-scapy
) ; entfernen Sie es dann:
sudo apt-get remove python-scapy
Wenn Sie fertig sind, können Sie wieder auf python3.4
den update-alternative
Befehl zurückgreifen