Page 1 of 1

Python problem?

Posted: April 29th, 2021, 10:39 am
by meredith102
My system is slackware 64 current, and python versions are 2 . 7 . 18 and 3 . 9 . 4

I have tried both 3 . 2 . 1 and 3 . 3 . 0 beta 3, and both display the same problem.

If I run from the icon, the program crashes instantly. If I run it from a command prompt, I am told there is a syntax error in the file (prog) . py at line 128.

(Sorry if this looks a bit odd, but the board keeps telling me I'm not allowed to post links - even though there are none! I'm really struggling to discover what it thinks is a link!!!)

Any pointers gratefully received!

Re: Python problem?

Posted: April 29th, 2021, 11:18 am
by sander
You must start SABnzbd like this:

python3 SABnzbd.py


If that that doesn't work, post your full log on https://pastebin.com/ and paste the URL (with spaces around the dots) here.

Re: Python problem?

Posted: April 29th, 2021, 12:49 pm
by meredith102
OK, thanks for the tip! I'll have a look in the morning and report back.

--
Pete

Re: Python problem?

Posted: April 29th, 2021, 4:12 pm
by meredith102
Yes, that was it! Did I miss that in the documentation somewhere? I was also missing a python plug-in (cheetah), but the error message helpfully pointed me to the wiki which told me how to fix it.

Many thanks!

--
Pete

Re: Python problem?

Posted: April 29th, 2021, 11:28 pm
by sander
Great.

With SABnzbd 3.0.0 and higher, you must use python3. That's all.
running from source https://sabnzbd.org/wiki/installation/i ... ff-modules

Re: Python problem?

Posted: April 30th, 2021, 2:44 am
by meredith102
Yes, I knew it had to use python 3, but foolishly thought it would default to that. I think Slackware just keeps python 2 on board for compatibility reasons with some software.

Anyway, all sorted now, so many thanks!

BTW, the "link" the forum was objecting to was sabnzbd (dot) py! Took me ages to work it out...!

--
Pete

Re: Python problem?

Posted: April 30th, 2021, 4:34 am
by sander
"python" is ambiguous: it is often python2 (for historical reasons), sometimes it might point to python3

So best (as in: unambiguous) to specify python3. That always works.

But the good news: the first line of SABnzbd.py itself says "#!/usr/bin/python3 -OO", so normally on POSIX (which honors that first line), you can start SAB with "./SABnzbd.py". That works ... if /usr/bin/python3 does exist ... which is often the case.