Problem running a python script for postproc

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.
rudyb
Newbie
Newbie
Posts: 28
Joined: December 8th, 2009, 11:46 pm

Re: Problem running a python script for postproc

Post by rudyb »

Cool, thanks!
Alives
Newbie
Newbie
Posts: 2
Joined: July 8th, 2012, 4:58 pm

Re: Problem running a python script for postproc

Post by Alives »

I am getting this error now as well. Python has been installed via cygwin, and is in the system path.

Code: Select all

'python' is not recognized as an internal or external command,
operable program or batch file.
SABnzbd Version: 0.7.0 running on Windows 7
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Problem running a python script for postproc

Post by shypike »

You did not tell Windows that the .py extension is associated with Python.
Check the PATHEXT environment variable, it should contain ".PY".
Then the assoc and ftype commands.
They should show things like this:

Code: Select all

D:\> ftype Python.File
Python.File="C:\bin\Python27\python.exe" "%1" %*

D:\> assoc .py
.py=Python.File 
lalalnx
Newbie
Newbie
Posts: 7
Joined: November 10th, 2010, 2:52 pm

Re: Problem running a python script for postproc

Post by lalalnx »

My python post processing script worked before 0.7.0, now I'm on 0.7.1 but I get this error with both 0.7.0 and 0.7.1:

'python' is not recognized as an internal or external command, operable program or batch file.

SABnzbd Category Setting: Script: sabToSickBeard.py
PATH: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Python27
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY
C:\Users\Administrator>ftype Python.File - Python.File="C:\Python27\python.exe" "%1" %*
C:\Users\Administrator>assoc .py - .py=Python.File

C:\Users\Administrator>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

I can also confirm that python is indeed located in C:\Python27\python.exe

Any ideas?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Problem running a python script for postproc

Post by shypike »

Are these paths actually available for SABnzbd?
There are system-level paths and user-level paths.
The fact that both 0.7.0 and 0.7.1 "stopped working" for this and
going back to 0.7.0 doesn't solve it, indicates a cause outside SABnzbd.

Anyway, there's a simple workaround. Use a wrapper script.

Code: Select all

@echo off
c:\python27\python.exe \path\to\script.py %1 %2 %3 %4 %5 %6 %7 %8 %9
Post Reply