1. 程式人生 > >ubuntu14 python3直譯器不能方向鍵

ubuntu14 python3直譯器不能方向鍵

1,參照:https://blog.csdn.net/xlf13872135090/article/details/25986509 $ sudo apt-get install libreadline6-dev 報錯: Traceback (most recent call last): File "/usr/bin/pycompile", line 35, in <module> from debpython.version import SUPPORTED, debsorted, vrepr, \ File "/usr/share/python/debpython/version.py", line 24, in <module> from ConfigParser import SafeConfigParser ModuleNotFoundError: No module named 'ConfigParser' dpkg: error processing package python-py (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python-pytest: python-pytest depends on python-py (>= 1.4.19); however: Package python-py is not configured yet. 原因可能是系統同時有python2和python3, 而apt-get預設python2 2,設定為Python3為預設(不清楚是否起作用) 參照:

https://blog.csdn.net/setoy/article/details/78587723 sudo update-alternatives --install /usr/bin/pythonpython/usr/bin/python2 100 sudo update-alternatives --install /usr/bin/pythonpython/usr/bin/python3 150 update-alternatives --config python 3,安裝錯誤提示中需要的軟體包 從:https://packages.ubuntu.com/ 下載python3-py,python3-pytest, libreadline6-dev安裝 $ sudo dpkg -i Downloads/python3-py_1.4.20-1_all.deb $ sudo dpkg -i Downloads/python3-pytest_2.5.1-1_all.deb $ sudo dpkg -i Downloads/libreadline6-dev_6.3-4ubuntu2_amd64.deb 重新編譯python3: $ cd Python-3.6.4/ $ ./configure $ make $ sudo make install 成功,python3中使用方向鍵正常 注:因為libreadline6-dev用apt-get和pip3都不能直接下載安裝,只能一個個安裝