caronc / nzb-notify

Push Notifications to a large number of supported services for NZBGet and SABnzbd (based on Apprise)
GNU General Public License v3.0
129 stars 16 forks source link

SCRIPT_MODE ImportError: No module named nzbget #60

Closed chesterweirdo closed 4 years ago

chesterweirdo commented 4 years ago

Sorry but I have spent ages trying to get this to work on a Synology NAS with Sabnzbd. I can send a slack notification via the command line but I get the following error in the Sab interface and it does not send

Notification script returned exit code 1 and output "Traceback (most recent call last): File "/usr/local/sabnzbd/var/scripts/Notify.py", line 175, in <module> from nzbget import SCRIPT_MODE ImportError: No module named nzbget "

I have run the requirements.txt and as I say the test via the command line is working. Any ideas?

caronc commented 4 years ago

Hmm, that error would suggest pynzbget isn't installed.

What happens if you directly try to install it?

pip install pynzbget
chesterweirdo commented 4 years ago

I get a warning about Python 2.7 then Requirement already satisfied: pynzbget in /usr/lib/python2.7/site-packages (0.6.4) Requirement already satisfied: lxml>=2.7 in /usr/lib/python2.7/site-packages (from pynzbget) (4.4.2) Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from pynzbget) (1.12.0)

What does not make sense is that python sabnzbd-notify.py complete 'Hello' 'Worldp' slack:// followed by my IDs works and a message arrives in Slack.

Could it be a permissions issue with the Sabnzdb user not being able to access it?

caronc commented 4 years ago

That's really weird. So it's installed globally, but PYTHONPATH is being over-ridden or pointing to a location where these modules can't be found.

I'm honestly not very familiar with Synology devices; but i realize they're very popular. Do you have control and/or access to where the service is being started from?

You could try to enforce a PYTHONPATH just before it's called:

# Make your global packages available
export PYTHONPATH=/usr/lib/python2.7/site-packages

# Now start Sabnzbd here
./SABnzbd.py

I know a lot of people do use this tool with Synology, It wouldn't hurt asking in their forums.

Tickets #59 and #53 are kinda/sorta relevant to your problem (but use Docker). I'm not sure if that's what Synology is using. If it is using Docker, then your problem makes more sense since your environment might have the libraries available, but not your docker instance.

caronc commented 4 years ago

Hey did you have any luck with this or are you still stuck?

caronc commented 4 years ago

Hey, it's been close to 2 weeks now and I hadn't heard back. I'm going to close this ticket; but if you're still having problems please feel free to comment in here (or open another ticket).

If you do find a solution, it would be great if you shared it here for others who may have a similar case. It might even be worth asking the Synology users if they can ship the SABnzbd with pynzbget and apprise (the 2 core files you need for everything to work).