Skip to content

Missing Packages in default Tautulli docker image (import requests & plexapi fails) #444

Description

@nicholasgcotton

Describe the bug

Python in the standard docker container for Tautulli (linuxserver/tautulli) doesn't include requests or plexapi, so the hide_episode_spoilers script fails when it tries to import them.

Provide logs

Tautulli logs - Please follow Tautulli's guide for sharing logs. Please provide a link to a gist or pastebin.

PlexAPI logs - Create or find your logs location for PlexAPI. Please follow Tautulli's guide for sharing logs. Please provide a link to a gist or pastebin.

Link to script with bug/issue

https://github.com/blacktwin/JBOPS/blob/master/utility/hide_episode_spoilers.py

To Reproduce

Run script on fresh install of linuxserver/tautulli

** Possible Solution **
Rewrite the import section to install the packages if they are needed.

import subprocess
import sys

def import_or_install(package):
    try:
        __import__(package)
    except ImportError:
        subprocess.check_call(['python3', '-m', 'pip', 'install', package])
        __import__(package)
import_or_install("requests")
import requests 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions