I banged my head on this for a while before solving it, so thought I'd post here to help others.
Problem:
I had a simple python script that makes a HTTP POST request that triggers a Prowl notification on my iPhone.
If I ran the script from the command line, it worked fine. I received the notification.
If I instead added it to the Vitamin D "Run a Command" action field and clicked 'Test' -- nothing happened.
I won't bore you with my many (many) attempts to figure out what was going on...
Reason for Problem:
When the script was triggered by Vitamin D, the PYTHONPATH and PYTHONHOME environment variables were being set to:
PYTHONHOME="/Applications/Vitamin D Video.app/Contents/Resources"
PYTHONPATH="/Applications/Vitamin D Video.app/Contents/Resources"
This means Python was unable to import the appropriate libraries.
The Fix:
The fix is to add a "-E" to the hashbang line in your script.
#!/usr/bin/python -E
This tells Python to ignore the environment variables and just use its defaults.
It isn't clear to me why those env vars are being set that way... if it is something that VitaminD is doing, perhaps they can stop.
Hope this saves someone else some head scratching.
