I already searched for solution to my problem via Google and serverfault's search facility, but haven't found anything related specifically to my case.

Here's the problem: I needed python 2.7.3 on CentOS 5.8 machine which has only python 2.4.3 preinstalled. Also neither there's the suitable version in it's repositories nor I can upgrade installed version. That's why I decided to build python from source code. But I've made a mistake: instead of make altinstall I did make install thus changing default version of the current installation. It was before I found this article - How to install Python 2.7.3 on CentOS 6.2 . I guess 5.8 and 6.2 versions aren't different to the extent this article is inapplicable. After installation of new python version I installed pip, but once I tried to invoke it, I got "No module named pkg_resources" error. In order to solve this issue I installed setuptools from repository. But it had only led to another error: "Distribution Not Found". My final step was to follow the guide I posted the link to, but I was unable to perform last step: easy_install-2.7 virtualenv command threw "-bash: /usr/local/bin/easy_install-2.7: .: bad interpreter: Permission denied" error. Now when I try to invoke pip or pip-2.7 both commands raise the same error with different names of binaries after "-bash:".

Is there any way to fix this problem, so I could install new python version (2.7.3) alongside with the preinstalled one (2.4.3) according to the guide? Any help will be appreciated.

P.S.: yum is working fine, although it needs python to function, so I hope the damage I unknowingly caused isn't very severe. Also I'm not a native English speaker, so I apologize for possible occasional grammatical and/or spelling errors.

1 Answer 1


First I'd try going back to the directory you ran the initial make install and attempt a: make uninstall.

If that doesn't work you are going to need to remove it manually. You can figure out what path it took by looking at the make file or by: make -n install > logfile 2>&1 Then you need to find the python package: rpm -qa | grep python and remove it rpm -e -nodeps <package>. To re-install it: rpm -ivh --force <package>.

Of course this is probably more work than just re-installing the OS, not easy, and not guaranteed to work...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .