1. 程式人生 > 其它 >python3 手動輸入時上下鍵亂碼(不支援翻看命令記錄)

python3 手動輸入時上下鍵亂碼(不支援翻看命令記錄)

檢查發現這個問題只在輸入python3是出現,如果輸入 /usr/bin/python3 則不會,

接著如下發現是python3.7才會有這種報錯,切換到python3.5則沒有,問題解決!

simon@simon-ZenBook:~$ python3
Python 3.7.0 (default, Jul 14 2020, 17:13:52)
    ^5.4.0 20160609] on linux
SyntaxError: invalid syntaxcredits" or "license" for more information.
>>> ^[[A^[[A^[[A^[[A^[[A
>>> exit()tdin>", line 1
simon@simon-ZenBook:~$ which python3
/usr/local/bin/python3
simon@simon-ZenBook:~$ ls -al /usr/local/bin/python3
lrwxrwxrwx 1 root root 9 Jul 14  2020 /usr/local/bin/python3 -> python3.7
simon@simon-ZenBook:~$ python3.5
python3.5             python3.5-dbg-config  python3.5dm-config
python3.5-dbg         python3.5dm           python3.5m
simon@simon-ZenBook:~$ python3.5
Python 3.5.2 (default, Jan 26 2021, 13:30:48)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> import re
>>> exit()
simon@simon-ZenBook:~$ python3.5
Python 3.5.2 (default, Jan 26 2021, 13:30:48)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> exit()