Page 1 of 1

Upgrading to Python 2.7 on Centos 6.x to meet requirements

Posted: November 16th, 2016, 3:01 am
by E71
Does anyone how or whether it's even possible to use scl on CentOS/RHEL to get SABnzbd 1.1.x working?

Can't update python 2.6 to 2.7 because of yum's dependency on it.

Installed python27-* via yum, added source /opt/rh/python27/enable to .bashrc of user that runs SABnzbd and even though python -V returns Python 2.7.8, it still gives the Sorry, requires Python 2.7. error.

-----------

Using CentOS 6.7 (64-bit) and SABnzbd v1.1.1


Thanks,
E.

Re: Upgrading to Python 2.7 on Centos 6.x to meet requiremen

Posted: November 16th, 2016, 8:42 am
by sander
even though python -V returns Python 2.7.8, it still gives the Sorry, requires Python 2.7. error.
Unlikely; this is the code in SABnzbd.py, so any python 2.7 is good

Code: Select all

import sys
if sys.version_info[:2] < (2, 7) or sys.version_info[:2] >= (3, 0):
    print "Sorry, requires Python 2.7."
    sys.exit(1)
I run SABnzbd 1.1.1 perfectly with Python 2.7.6 on my old Ubuntu 14.04.

Code: Select all

$ sabnzbdplus
2016-11-16 14:42:57,148::INFO::[sabnzbdplus:1218] --------------------------------
2016-11-16 14:42:57,177::INFO::[sabnzbdplus:1219] sabnzbdplus-1.1.1RC2 (rev=01d668ac08e4bc79c6e0a36e622d3ff3299068b4)
2016-11-16 14:42:57,178::INFO::[sabnzbdplus:1220] Full executable path = /usr/bin/sabnzbdplus
2016-11-16 14:42:57,179::INFO::[sabnzbdplus:1232] Platform = posix
2016-11-16 14:42:57,179::INFO::[sabnzbdplus:1233] Python-version = 2.7.6 (default, Jun 22 2015, 18:00:18)
[GCC 4.8.2]
2016-11-16 14:42:57,180::INFO::[sabnzbdplus:1234] Arguments = /usr/bin/sabnzbdplus
My gyess: you now have two Python versions, and SAB is using the wrong one. Check your sabnzbd.log.

Re: Upgrading to Python 2.7 on Centos 6.x to meet requiremen

Posted: November 16th, 2016, 4:53 pm
by E71
sander wrote: My gyess: you now have two Python versions, and SAB is using the wrong one. Check your sabnzbd.log.
Yes, that's right, I have both 2.6.6 and 2.7.8 installed. Version 2.7.8 was installed via CentOS SCL, which in my opinion feels a bit like a hack on RedHat's part, for getting newer software like Python running on demand.

Because of this, my question is for those familiar with both how SCL works and SAB.

Log shows SAB is picking up version 2.6.6 every time but in the shell script called by SAB's init.d script, I have the following two lines inserted before the python SABnzbd.py --server 0.0.0.0:port -d --config-file "/path/to/sabnzbd.ini command:

Code: Select all

which python
python -V
When starting up SAB, it outputs:

Code: Select all

/opt/rh/python27/root/usr/bin/python
Python 2.7.8
Shows that the python 2.7.8 software collection library has been enabled. I'm wondering what additional steps are needed to get SAB to use Python (2.7.8) -- a particular environment variable perhaps?

Thanks,
E.

Re: Upgrading to Python 2.7 on Centos 6.x to meet requiremen

Posted: November 16th, 2016, 7:18 pm
by E71
Well, I found out what was causing it to use python 2.6.6 -- my old startup script made adjustments to PATH... It's an old script so I don't remember why I did that.

Anyway, after getting past that and re-installing cheetah, pyopenssl and yenc, it's running again.

Re: Upgrading to Python 2.7 on Centos 6.x to meet requiremen

Posted: November 17th, 2016, 5:15 am
by safihre
Great!