sabnzbd won't start, complains that python 2.x is not installed Reproducible: Always Steps to Reproduce: 1. eselect python3 as the default python 2. /etc/init.d/sabnzbd start Actual Results: sabnzbd won't start Expected Results: sabnzbd starts when I start sabnzbd with: /etc/init.d/sabnzbd start I get the following output: ---------------------- * Caching service dependencies ... [ ok ] * Starting SABnzbd ... File "SABnzbd.py", line 20 print "Sorry, requires Python 2.5, 2.6 or 2.7." ^ SyntaxError: invalid syntax * start-stop-daemon: failed to start `/usr/bin/sabnzbd' [ !! ] * ERROR: sabnzbd failed to start --- ------------------------------------------------ that is because my default python is v3. the thing is that if I edit the file /usr/share/sabnzbd/SABnzbd.py and change the first line from #!/usr/bin/python -OO to #!/usr/bin/python2.7 -OO I still get that error. so I removed the version check, which means I commented out these lines: if sys.version_info < (2, 5): print "Sorry, requires Python 2.5, 2.6 or 2.7." sys.exit(1) then I get the following error: print "Sorry, requires Python module Cheetah 2.0rc7 or higher. I tried to recompile Cheetah. it didn't resolve the issue! when I revert the SABnzbd.py file, and change the default system python to version 2.7 instead of 3.2. sabnzbd works properly.
Can you try applying the following to /usr/bin/sabnzbd? diff -u -r1.1 sabnzbd --- files/sabnzbd 3 Jan 2013 20:02:32 -0000 1.1 +++ files/sabnzbd 10 Jan 2013 00:11:31 -0000 @@ -1,3 +1,14 @@ #!/bin/sh -cd /usr/share/sabnzbd && python SABnzbd.py $* +pyexe=python2.7 + +if [ ! -x /usr/bin/${pyexe} ]; then + pyexe=python2.6 +fi + +if [ ! -x /usr/bin/${pyexe} ]; then + echo "No suitable python executable found in /usr/sbin (python2.6 || python2.7)" + exit 1 +fi + +cd /usr/share/sabnzbd && /usr/bin/${pyexe} SABnzbd.py $*
(In reply to comment #1) > Can you try applying the following to /usr/bin/sabnzbd? I had the same issue (my default version of python is 3.2), this patch fixes it. Executing /usr/bin/sabnzbd directly and starting it as a daemon both work.
11 Jan 2013; Justin Bronder <jsbronder@gentoo.org> files/sabnzbd: Wrap sabnzbd.py with either python2.7 or python2.6. Resolves #450698. Thanks for testing.
yay! it resolves the problem. thanks