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

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
E71
Newbie
Newbie
Posts: 42
Joined: January 13th, 2009, 10:08 pm

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

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

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

Post 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.
User avatar
E71
Newbie
Newbie
Posts: 42
Joined: January 13th, 2009, 10:08 pm

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

Post 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.
User avatar
E71
Newbie
Newbie
Posts: 42
Joined: January 13th, 2009, 10:08 pm

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

Post 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.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

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

Post by safihre »

Great!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply