1

There are two versions of Python that can be installed on RHEL 6.7, as many obviously know. Yum needs 2.6, and other programs for example Graphite need 2.7

After digging into it, I see that even when I have a shell spawned or started with scl enable python27 bash

I am having to issue commands like :

LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64 /opt/rh/python27/root/usr/bin/uwsgi

I.E. start the correct version of uwsgi with the correct version on python.

Is there a way that I can alias these, create a special shell or something so that I don’t cause conflicts between the two version when yum is issued? How can they be activated in a virtualenv for example, and have yum disabled, wouldn't that make installing things difficult?

I know how to set them as defaults, but it’s annoying to have to unset and reset every time you need to install a package or restart the system or a service.

1 Answer 1

0

not sure this is what you need, but one way to have several versions of software installed is environment modules (http://modules.sourceforge.net) although this is most often used by users to control their software and less often by admins

if you need something specific to python, then (python) virtualenv will also work, but the environment modules are a bit more versatile

3
  • There perhaps is something I missed. I am using virtualenv with the same issues.
    – Bob R
    Feb 3, 2016 at 16:28
  • when choosing your virtualenv, do you pass the --no-site-packages option? that could be it
    – liskawc
    Feb 3, 2016 at 18:00
  • yes that was it, and not needing to run things with sudo. Works great!
    – Bob R
    Feb 4, 2016 at 0:31

You must log in to answer this question.

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