caronc / nzb-notify

Push Notifications to a large number of supported services for NZBGet and SABnzbd (based on Apprise)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: No module named pkg_resources

Tharic99 opened this issue · comments

I'm trying to get nzb-notify up and running on my NZBGET.

I'm running NZBGet in the Linuxserver docker container and I see that recently they added pip modules into NZBGET, as indicated here - linuxserver/docker-nzbget#69

However, when I'm running a test on nzb-notify, I get the following message:

Executing script Notify.py with command TestServers
Notify: Traceback (most recent call last):
Notify: File "/downloads/usenet/nzbgetroot/scripts/Notify.py", line 181, in
Notify: from apprise import Apprise
Notify: File "/usr/lib/python2.7/site-packages/apprise/init.py", line 49, in
Notify: from .Apprise import Apprise
Notify: File "/usr/lib/python2.7/site-packages/apprise/Apprise.py", line 29, in
Notify: from markdown import markdown
Notify: File "/usr/lib/python2.7/site-packages/markdown/init.py", line 25, in
Notify: from .core import Markdown, markdown, markdownFromFile
Notify: File "/usr/lib/python2.7/site-packages/markdown/core.py", line 29, in
Notify: import pkg_resources
Notify: ImportError: No module named pkg_resources
Script Notify.py with command TestServers failed (terminated with unknown status)

I'm not certain if the pkg_resources is from nzb-notify or from the pip modules that are included in NZBGET now. There's some additional info here as well - https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources

Thanks

Good find; i think this is a result of setuptools missing as you've observed.

you might be able to just call pip install setuptools and be alright going forward. It's unfortunate though because the bug should really reside inside the markdown library (since it's the one needing it, not nzb-notify).

Just to follow-up, I've got a solution for this now. We talked it through on the DockStarter discord and here's the solution that I used to resolve it, in case it helps anyone else down the road running this under a docker image.

Go to your ~/.config/appdata/nzbget/ folder and create a new folder named custom-cont-init.d and inside it create a file named 00-install-setuptools and in that file put

#!/usr/bin/with-contenv bash
apk add --no-cache --upgrade py2-pip
pip install -r /config/custom-cont-init.d/requirements.txt

Then pull down the requirements.txt file from the git for nzb-notify and place it into the custom-cont-init.d folder you created.

Stop and restart nzbget and your test message from NZBGet to Docker should work successfully.