[CentOS] upgrading python

Mon Dec 11 22:50:14 UTC 2017
Larry Martell <larry.martell at gmail.com>

On Mon, Dec 11, 2017 at 5:43 PM, Clint Dilks <clintd at scms.waikato.ac.nz> wrote:
> On Tue, Dec 12, 2017 at 11:31 AM, <m.roth at 5-cent.us> wrote:
>
>> Pete Biggs wrote:
>> > On Mon, 2017-12-11 at 15:44 -0600, Frank Cox wrote:
>> >> On Mon, 11 Dec 2017 16:32:06 -0500
>> >> Larry Martell wrote:
>> >>
>> >> > Can I make that the default python?
>> >>
>> >> ~/.bashrc
>> >>
>> > No. I'm not entirely sure that is a good idea! No, not all.
>> >
>> > 'scl enable python27 bash' creates a *new* shell with the correct
>> > environment.  As each invocation of bash reads .bashrc, it will also
>> > create another new shell which will then read .bashrc and create
>> > another shell ....
>> >
>> > Depending on the speed of your machine and disks and how much memory
>> > you have, it will take a few seconds to a few minutes to grind your
>> > machine to a halt.
>>
>> The simplest way is to . <path/to/python2.7/enable, and you're good to go.

> I definitely wouldn't make it the default python, but I have made it the
> default for a particular user as long as they are not root.
>
> In the past I have got python27-mod_wsgi and httpd24-httpd working together
> by doing things like httpd24-httpd by doing things like
>
>
> cat /opt/rh/httpd24/root/etc/sysconfig/httpd
>
> export PATH=/opt/rh/python27/root/usr/bin:$PATH
> export
> LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

I am running nginx and uWSGI. I added this to /etc/systemd/system/uwsgi.service:

ExecStart=/usr/bin/scl enable python27 bash; /usr/bin/uwsgi --emperor
/etc/uwsgi/sites

But it did not start:

   Loaded: loaded (/etc/systemd/system/uwsgi.service; enabled; vendor
preset: disabled)
   Active: failed (Result: start-limit) since Mon 2017-12-11 17:20:36
EST; 6s ago
  Process: 24492 ExecStart=/usr/bin/scl enable python27 bash;
/usr/bin/uwsgi --emperor /etc/uwsgi/sites (code=exited,
status=1/FAILURE)