mdhiggins/sma-mod

manual.py not finding guessit.py

Closed this issue · 2 comments

I just installed the docker mod version and tried to run manual.py to test out some files and tweak my config. But it errors out same as is mentioned in #4, no guessit. Are the requirements not being processed (or included?)

./manual.py
Traceback (most recent call last):
  File "/usr/local/sma/./manual.py", line 5, in <module>
    import guessit
ModuleNotFoundError: No module named 'guessit'

Originally posted by @VampiricAlien in #4 (comment)

root@sonarr:/# /usr/local/sma/manual.py
Traceback (most recent call last):
  File "/usr/local/sma/manual.py", line 5, in <module>
    import guessit
ModuleNotFoundError: No module named 'guessit'
root@sonarr:/# /usr/local/sma/postSonarr.sh
2023-04-12 01:24:09 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2023-04-12 01:24:09 - SonarrPostProcess - ERROR - Invalid event type None, script only works for On Download/On Import and On Upgrade.
root@sonarr:/# /usr/local/sma/postSonarr.py
Traceback (most recent call last):
  File "/usr/local/sma/postSonarr.py", line 4, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
root@sonarr:/# ^C
root@sonarr:/# 


fatal: detected dubious ownership in repository at '/usr/local/sma'
To add an exception for this directory, call:
git config --global --add safe.directory /usr/local/sma

guessit.py seems to be installed in /usr/local/sma/venv/lib/python3.10/site-packages

But I just noticed the ENV variables listed at https://github.com/mdhiggins/sma-mod#environment-variables are not set when I docker exec /bin/bash into sonarr with the mod installed.

$ env
PUID=1001
HOSTNAME=269a662426f5
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
LANGUAGE=en_US.UTF-8
XDG_CONFIG_HOME=/config/xdg
PWD=/usr/local/sma/venv/lib/python3.10/site-packages
TZ=CST6CDT
HOME=/root
LANG=en_US.UTF-8
PGID=100
VIRTUAL_ENV=/lsiopy
S6_VERBOSITY=1
S6_STAGE2_HOOK=/docker-mods
TERM=xterm
DOCKER_MODS=linuxserver/mods:radarr-striptracks|mdhiggins/sma-mod:latest
SHLVL=1
LSIO_FIRST_PARTY=true
PATH=/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SONARR_BRANCH=main
_=/usr/bin/env
OLDPWD=/usr/local/sma/venv/lib

I'm running sonarr:latest. I tried both sma-mod:latest and sma-mod:s6v2 , results are the same.

Ok, I figured it out, but this should be better documented. I can't simply run manual.py, I have to make sure the venv python3 is being used as I found out in mdhiggins/sickbeard_mp4_automator#1645 (comment)

Maybe a manual.sh similar to postSonarr.sh should be added so others won't accidentally run into this issue.

Thank you for all your work on this program.