您的位置:首页 > 编程语言 > Python开发

ImportError: No module named 'ConfigParser'

2015-08-24 16:11 716 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu python configparser