Code Monkey home page Code Monkey logo

Comments (21)

caronc avatar caronc commented on May 23, 2024 1

The last few things you could try is manually running the script yourself to see if you get the same error:

# Just to test things:
python /path/to/sabnzbd/sabnzbd-notify.py complete 'Hello' 'World' <Apprise URL here>

If that works then there is something unique about your SABnzbd installation; the environment it runs in is completely different the the one you're in when you call the script. Perhaps a Python virtual env?

If that doesn't work, then the problem gets a bit easier to solve because at least it's reproducible

from nzb-notify.

Squiggles4321 avatar Squiggles4321 commented on May 23, 2024 1

Hey,

If you have python3 on your system as well, but python2 is still the system default just edit sabnzbd-notify.py and Notify.py and change:

#!/usr/bin/env python
to
#!/usr/bin/env python3

It is what I had to do in my multi-python system. Working fine now when it invokes python3.

-Squigs

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

You're just missing the plugins that this script relies on:

pip install -r requirements.txt

#alternatively this should work too:
pip install pynzbget

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Actually I did install all requirements and tested this 'pip install pynzbget' and it also said requirements already satisfied.
But still SABnzdbd is returning same error code

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

Strange, is SABnzbd running in a Docker container? These commands need to be ran in there if so.

What is your os? Also, what version of Python and SABnzbd are you using?

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

No docker and using ubuntu 18.04
SAbnzbd version : 3.1.0RC3 [6aef50d]
Python : python 3.8.2

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

I wonder if this is an issue with multiple python versions. Can you try same pip commands, but use pip3 instead?

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Already did too, all requirements satisfied as well

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

So just tested and getting the same error code :
image

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

Sorry for the long delay; It seems like your pip repository got damaged or corrupted some how. I would just uninstall pynzbget and put it back in. Hopefully the system will pick it up then:

pip uninstall pynzbget
pip install pynzbget

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Hey
Just tried that but still getting the same error message, both from SABnzbd and by testing directly in CLI

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

that's really weird, there is definitely something wrong with your environment πŸ™ .

i verified the script works correctly by doing the following myself:

# create a new virtual environment to test with:
python3 -m venv test-nzb-notfify

# Change into our new directory
cd  test-nzb-notfify

# Activate our virtual environment
source bin/activate

# Install pynzbget
pip install pynzbget

# test that the environment variables are importable:
python -c "from nzbget import SCRIPT_MODE" && echo "OKAY" || or echo "Fail"

The above outputs OKAY every-time for me; i get no import error. If installation the library and reloading it doesn't work then there is something that is obstructing your Python library of installed packages.

Another possibility is there is another Python library called nzbget installed into your library and when your system calls from nzbget import SCRIPT_MODE it can't find it.

You could check inside your SABnzbd installation directory and make sure there is no directory called nzbget with an __init__.py file in it... OR a file called nzbget.py. The other thing you could do (to test this theory) is open up a python console (just type python) and do the following:

# in a python terminal:
import nzbget

# If the above does not give you an error then something was found and imported...

# Test that it is a module:
print(type(nzbget))
# expect output like: <class 'module'>

# Now find out where this module came from:
print(nzbget.__file__)

# Verify that the path that is outputed is indeed where you installed pynzbget;  My guess is this
# is not valid package.  Or if it is (that's fine too), but it isn't the one you want :slightly_smiling_face: 

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Hi

Thanks for chekcing further

So actually looking in my SABnzbd directory I found another file 'init.py'
First one is there /home/user/SABnzbd/sabnzbd/init.py
the second is the one from your script here /home/user/SABnzbd/scripts/Notify/init.py

Then I aslo ran a python terminal with first command and it gave me this :

(1:355)# python
Python 2.7.17 (default, Sep 30 2020, 13:38:04)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import nzbget
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named nzbget

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

So i can see one problem already; up above, you said:

SAbnzbd version : 3.1.0RC3 [6aef50d]
Python : python 3.8.2

SABnzbd requries Python v3. so this all makes sense. But your last comment shows you running the test using Python v2.7 (which operates in a completely different realm and requires a separate pip installation for it).

In a situation where you have both Python v2 and v3, you need to use pip3 or pip to separate the calls. You also need to use the binary python3 and python (for v2 references).

Python 2.7.17 (default, Sep 30 2020, 13:38:04)

Is it possible that pynzbget is properly installed in your Python 3 environment and both you and your SABnzbd is running in a Python 2 environment? Another issue that can cause problems is stale .pyc files. You could try stopping SABnzbd and removing the .pyc files if any were created (this is safe; don't worry). Something like:

find /path/to/your/sabnzbd/installation -type f -name '*.pyc' --delete

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Not sure I'm doing this right ?
image

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

and yes for Python that's weir, but SABnzbd says I'm running this :
image

I'm running the seedbox script Quickbox Pro FYI, and they use different python version as I understood, for example for Tautulli I had to manually change the config file to run with Python 3 and then run some scripts.

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

So the catch is, you can't just change to use the python 3 binary you have installed on the Quickbox Pro setup. You need to change your environment as well so your virtually sitting in the same world as SABnzbd is.

I don't know much about Quickbox Pro or how SABnzbd gets installed into it with a custom version of Python. You'll need to mimic it's environment variables and stuff since entries like PYTHONPATH for example can cause your application to look in one location for all of it's packages while you install it in another. Do you have the instructions or tricks you did to install SABnzbd? Does Quickbox just run natively on a server? Or is it like managing docker containers for you? It might be setting up virtual environments so that some applications don't step on others?

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Hi

Thanks for checking all this, I'll share this case with Quickbox Pro support team because honestly I don't have so much information abaout hw it works etc...
Will keep you updated if I have some progress.

Thank you for the support again !

from nzb-notify.

SuissoNaBisso9 avatar SuissoNaBisso9 commented on May 23, 2024

Hey @Squiggles4321
Just tried that but i'm stil getting the same errors as usual.
Will have to check further with Quickbox Pro support team

Thanks !

from nzb-notify.

Squiggles4321 avatar Squiggles4321 commented on May 23, 2024

Very specific to your environment then. Good luck.

-Squigs

from nzb-notify.

caronc avatar caronc commented on May 23, 2024

I'm closing this ticket off; unfortunately it's 100% related to the python installation and it's configured environment

from nzb-notify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.