ImportError: No module named 'ConfigParser'

Resolve Method:

I found the problem. I had manually installed a newer version of python (version 3.2 but the version installed through packages is 2.7) and I just redirected /usr/bin/python to python3.2. Apparently in 3.2 some syntax used in /usr/bin/pyclean is not valid anymore. Restoring the original link of /usr/bin/python to /usr/bin/python2 solved the problem. Now the scripts could be run without any issues.

the link: StackOverflow


按照這想法,我順利解決了這個問題。

我的系統是ubuntu 14.04,安裝了python2.7

看到這裏後,安裝了python3,並按順序執行以下命令

# 修改python爲python2

rm /usr/bin/python

ln -s /usr/bin/python2 /usr/bin/python

# 刪除python-configparser,再通過aptitude來安裝

sudo apt-get purge --auto-remove python-configparser

sudo aptitude install python-configparser

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章