码迷,mamicode.com
首页 > 其他好文 > 详细

ImportError: No module named 'ConfigParser'

时间:2017-07-24 16:24:04      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:sans   data   console   hit   not   tac   sed   original   family   

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

ImportError: No module named 'ConfigParser'

标签:sans   data   console   hit   not   tac   sed   original   family   

原文地址:http://www.cnblogs.com/liguangsunls/p/7229141.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!