Getting Yum To Install To Python 2.7 Dir
I am running CentOS 6.5, which has python 2.6. I need python 2.7 so I
installed that and it works and is my default python. But yum does not work with that, so I changed the shebang line for yum to
/usr/bin/python2.6 and then yum works again. But when I install a python package with yum it get installed to
/usr/lib64/python2.6/site-packages/. How can I get yum to install to
/usr/lib64/python2.7/site-packages?
Thanks!
11 thoughts on - Getting Yum To Install To Python 2.7 Dir
You don’t. That’s determined by the package build, not anything to do with the package installer tools (either rpm or yum). Some 3rd party repositories like IUS or software collections have python27, and that’s the best way to install it. If you’ve built your python from source, then you’ve circumvented the package manager and done “Bad Things”.
No I installed 2.7 from a repo that had it. So now I guess I have to find 2.7 repos for all the packages we use.
no repo intended for CentOS6/RHEL6 should have replaced /usr/bin/python with a newer version. there’s no way to do that without breaking ALL
the python software included with CentOS6
putting it somewhere like /opt/python27 or /usr/local/python27, sure.
Indeed. One wonders what repo this might be.
John
This is a bad hack. Undo the damage. Then install the official CentOS
Software Collections repo.
https://www.softwarecollections.org/en/
It has Python27.
I just asked the list how to install Python3 on CentOS. After having looked at the other options, SCL was IMHO, the easiest and best solution. Red Hat/CentOS has really hit a home run with SCL.
I followed the instruction on that link and discovered that one basically needs to be a RedHat subscriber to get any use out of it. At least insofar as httpd-2.4 is concerned. I cannot speak what restrictions, if any, are placed on the Python-2.7 package.
It did not install to /usr/bin/python – I never said that it did. It installed to /usr/local/bin/python2.7. I then linked
/usr/local/bin/python2.7 to /usr/bin/python so 2.7 would be picked up as the default.
Thanks, this look promising. Does it have 2.7 versions of things like django, MySQLdb, mod_wsgi, and other popular packages?
http://wiki.CentOS.org/AdditionalResources/Repositories/SCL
https://access.redhat.com/site/documentation/en-US/Red_Hat_Software_Collections/1/html-single/1.0_Release_Notes/index.html#sect-RHSCL-Features
instead, you should have put /usr/local/bin in your path in front of
/usr/bin just for those users or jobs that need it.