当前位置首页 > Ubuntu知识

Ubuntu上修复Python

阅读次数:249 次  来源:admin  发布时间:

今天在测试机上有同学不小心删除了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_resource

解决方法是重装distribute

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

上一篇:Nginx的启动、停止与重启
下一篇:Win7系统安装Centos7.0双系统(三)Win7系统安装Centos7.0双系统(一)Win7系统安装Centos7.0双