blacktwin / JBOPS

Just a Bunch Of Plex Scripts
1.67k stars 307 forks source link

Plex/LIFX Script Error #324

Closed sydtrakked closed 2 years ago

sydtrakked commented 2 years ago

Describe the bug

Receiving this error in Tautulli Logs when script is trying to run:

Tautulli Notifiers :: Script error: Traceback (most recent call last): File "c:\Plifx\plex_lifx_LivingRoom.pyw", line 22, in import numpy ModuleNotFoundError: No module named 'numpy'

Provide logs https://gist.github.com/sydtrakked/26326383a5ac6e46ff4105e5ac67db4b

Link to script with bug/issue https://github.com/blacktwin/JBOPS/blob/master/fun/plex_lifx_color_theme.pyw

To Reproduce

Steps to reproduce the behavior:

  1. Play some content
  2. Script doesn't run successfully

Expected behavior Script should run and update LIFX lights

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

blacktwin commented 2 years ago

@philosowaffle pinging you as I do not have the required environment and you are the creator.

philosowaffle commented 2 years ago

@blacktwin this looks like a simple dependency issue. Is the global requirementes.txt where you want scripts to add packages they need?

For reference, here is the original requirements.txt file for this script: https://github.com/philosowaffle/plex-lifx-webhook/blob/master/requirements.txt#L3

blacktwin commented 2 years ago

Ugh, I didn't even read this issue before pinging you... Sorry about that @philosowaffle. Let's leave it as is for now.

@sydtrakked you need to install the missing module that is listed in the error message. You can do by running pip install numpy in cmd.

philosowaffle commented 2 years ago

@sydtrakked full list of things you might need to install:

> pip install numpy
> pip install colorthief
> pip install pifx==0.0.3
sydtrakked commented 2 years ago

so weird because it's been working fine for so long and I haven't made any changes. Sorry for any time wasted on your parts! Thanks for checking in on everything.

sydtrakked commented 2 years ago

So the change that did happen is actually that my server is using Python 3.X now and it appears that urllib.urlretrieve has been deprecated.

I'm pretty noobish with python but maybe you would be able to update this script more efficiently than I can? From what I gather urlretrieve is now within urlib.request function

EDIT: I believe I resolved it by simply changing a few lines.

import urllib.request

urllib.request.urlretrieve(url, path)

Although I've seen that request.urlretrieve is not guaranteed to not get deprecated altogether in the future.