Ubuntu上修复Python

今天在测试机上有同学不小心删除了python2.7的目录。。。

然后维修的活儿就交到我手上了。

刚开始我以为挺轻松的,结果整了一个小时。遇到了好多棘手的问题。

首先遭遇的问题是:

No such file or directory: '/usr/local/lib/python2.7/dist-packages/setuptools.egg-info'

解决办法:发现该文件是软连接问题,链接地址有误,删了重设

接着是

ImportError: Entry point ('console_scripts', 'easy_install-2.6') not found

我使用了setuptool.egg ,ez_setup.py,apt-get install python-setuptools均无效。最后在一个看似无关的帖子中,受到了启发:

http://ubuntuforums.org/showthread.php?t=1841850

使用which -a easy_install 

发现原来有两个路径下存在easy_install的可执行文件。发现用apt-get装的是罪魁祸首之后,remove掉,问题解决。

最后是

No module named pkg_resources

解决方法是重装distribute

相关连接:http://stackoverflow.com/questions/7446187/no-module-named-pkg-resources 

 

posted @ 2012-08-28 18:36  牛皮糖NewPtone  阅读(9282)  评论(0编辑  收藏  举报