今天在測試機上有同學不小心刪除了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
