Mopidy Extension not Loading when run as Service

Hi - First off, apologies in advance for the long post.

I have Mopidy installed and configured to use the local extension to play music on my 18.04 ubuntu server as a service, and it works great.

I am trying however to use another extension (mopidy-jellyfin) to connect to my jellyfin install, and for some reason, when mopidy is run as a service, it does not pick up the jellyfin extension. However, when I run mopidy manually with the same conf, the extension is picked up as it should be. Here is my service status showing that the jellyfin extension is not identified by the service:

kevin@linuxserver:/$ sudo service mopidy status
● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-01-04 14:44:06 EST; 3s ago
  Process: 9536 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 9527 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 9538 (mopidy)
    Tasks: 12 (limit: 4279)
   CGroup: /system.slice/mopidy.service
           └─9538 /usr/bin/python /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Creating dir /var/lib/mopidy/.local/share/mopidy/m3u
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Audio output set to "audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfi
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Starting Mopidy core
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Starting Mopidy frontends: IrisFrontend, MpdFrontend, HttpFrontend
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Starting Iris 3.43.0
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     MPD server running at [::]:6600
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     HTTP server running at [::]:6680
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Starting GLib mainloop
Jan 04 14:44:06 linuxserver mopidy[9538]: INFO     Creating dir /var/lib/mopidy/.local/share/mopidy/local-images

And here is when I run mopidy manually with the same conf, where jellyfin is picked up:

kevin@linuxserver:/$ sudo mopidy --config /etc/mopidy/mopidy.conf
/usr/lib/python2.7/dist-packages/mopidy/ext.py:202: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
  extension_class = entry_point.load(require=False)
INFO     Starting Mopidy 2.1.0
INFO     Loading config from builtin defaults
INFO     Loading config from /etc/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Enabled extensions: iris, mpd, http, moped, stream, m3u, softwaremixer, file, local-images, jellyfin
INFO     Disabled extensions: local
INFO     Starting Mopidy mixer: SoftwareMixer
INFO     Starting Mopidy audio
INFO     Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, JellyfinBackend
INFO     Audio output set to "audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo"
INFO     Starting Mopidy core
INFO     Starting Mopidy frontends: MpdFrontend, HttpFrontend, IrisFrontend
INFO     MPD server running at [::]:6600
INFO     HTTP server running at [::]:6680
INFO     Starting Iris 3.43.0
INFO     Starting GLib mainloop

I saw from this page that perhaps this has something to do with mopidy vs mopidyctl, and when I run the same command as above using mopidyctl, jellyfin is again not picked up:

kevin@linuxserver:/$ sudo mopidyctl --config /etc/mopidy/mopidy.conf
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf --config /etc/mopidy/mopidy.conf" as user mopidy
INFO     Starting Mopidy 2.1.0
INFO     Loading config from builtin defaults
INFO     Loading config from /etc/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Enabled extensions: iris, mpd, http, file, stream, m3u, softwaremixer, moped, local-images
INFO     Disabled extensions: local
INFO     Starting Mopidy mixer: SoftwareMixer
INFO     Starting Mopidy audio
INFO     Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend
INFO     Audio output set to "audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo"
INFO     Starting Mopidy core
INFO     Starting Mopidy frontends: IrisFrontend, MpdFrontend, HttpFrontend
INFO     Starting Iris 3.43.0
INFO     MPD server running at [::]:6600
INFO     HTTP server running at [::]:6680
INFO     Starting GLib mainloop

Finally, when I run mopidy deps vs sudo mopidyctl deps it seems like I’m running 2 different versions of mopidy? I’m not sure if that has anything to do with anything, but again, when running mopidy, jellyfin shows up, whereas with mopidyctl, it doesn’t.

kevin@linuxserver:/$ mopidy deps
Executable: /home/kevin/.local/bin/mopidy
Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic
Python: CPython 2.7.17 from /usr/lib/python2.7
Mopidy: 2.3.1 from /home/kevin/.local/lib/python2.7/site-packages
  Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
  tornado<6,>=4.4: 5.1.1 from /home/kevin/.local/lib/python2.7/site-packages
    backports-abc>=0.4: 0.5 from /home/kevin/.local/lib/python2.7/site-packages
    singledispatch: 3.4.0.3 from /home/kevin/.local/lib/python2.7/site-packages
      six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
    futures: 3.3.0 from /home/kevin/.local/lib/python2.7/site-packages
  requests>=2.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
    certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
    chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
    idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
    urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
  setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
Mopidy-Moped: 0.7.1 from /usr/local/lib/python2.7/dist-packages
  Mopidy>=1.0.0: 2.3.1 from /home/kevin/.local/lib/python2.7/site-packages
    Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
    tornado<6,>=4.4: 5.1.1 from /home/kevin/.local/lib/python2.7/site-packages
      backports-abc>=0.4: 0.5 from /home/kevin/.local/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /home/kevin/.local/lib/python2.7/site-packages
        six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
      futures: 3.3.0 from /home/kevin/.local/lib/python2.7/site-packages
    requests>=2.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
      certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
      chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
      idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
      urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
    setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
  setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
Mopidy-Local-Images: 1.0.0 from /usr/local/lib/python2.7/dist-packages
  uritools>=1.0: 2.2.0 from /usr/local/lib/python2.7/dist-packages
    ipaddress; python_version == "2.7": 1.0.17 from /usr/lib/python2.7/dist-packages
  setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
  Mopidy>=1.1: 2.3.1 from /home/kevin/.local/lib/python2.7/site-packages
    Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
    tornado<6,>=4.4: 5.1.1 from /home/kevin/.local/lib/python2.7/site-packages
      backports-abc>=0.4: 0.5 from /home/kevin/.local/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /home/kevin/.local/lib/python2.7/site-packages
        six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
      futures: 3.3.0 from /home/kevin/.local/lib/python2.7/site-packages
    requests>=2.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
      certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
      chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
      idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
      urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
    setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
  Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
Mopidy-Jellyfin: 0.6.0 from /home/kevin/.local/lib/python2.7/site-packages
  Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
  requests>=2.20: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
    certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
    chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
    idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
    urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
  Mopidy>=2.0: 2.3.1 from /home/kevin/.local/lib/python2.7/site-packages
    Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
    tornado<6,>=4.4: 5.1.1 from /home/kevin/.local/lib/python2.7/site-packages
      backports-abc>=0.4: 0.5 from /home/kevin/.local/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /home/kevin/.local/lib/python2.7/site-packages
        six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
      futures: 3.3.0 from /home/kevin/.local/lib/python2.7/site-packages
    requests>=2.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
      certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
      chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
      idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
      urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
    setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
  unidecode>=1.1: 1.1.1 from /home/kevin/.local/lib/python2.7/site-packages
  setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
Mopidy-Iris: 3.43.0 from /usr/local/lib/python2.7/dist-packages
  ConfigObj>=5.0.6: 5.0.6 from /usr/local/lib/python2.7/dist-packages
    six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
  Mopidy-Local-Images>=1.0: 1.0.0 from /usr/local/lib/python2.7/dist-packages
    uritools>=1.0: 2.2.0 from /usr/local/lib/python2.7/dist-packages
      ipaddress; python_version == "2.7": 1.0.17 from /usr/lib/python2.7/dist-packages
    setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
    Mopidy>=1.1: 2.3.1 from /home/kevin/.local/lib/python2.7/site-packages
      Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
      tornado<6,>=4.4: 5.1.1 from /home/kevin/.local/lib/python2.7/site-packages
        backports-abc>=0.4: 0.5 from /home/kevin/.local/lib/python2.7/site-packages
        singledispatch: 3.4.0.3 from /home/kevin/.local/lib/python2.7/site-packages
          six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
        futures: 3.3.0 from /home/kevin/.local/lib/python2.7/site-packages
      requests>=2.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
        certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
        chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
        idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
        urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
      setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
    Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
  Mopidy>=2.0: 2.3.1 from /home/kevin/.local/lib/python2.7/site-packages
    Pykka>=1.1: 2.0.2 from /home/kevin/.local/lib/python2.7/site-packages
    tornado<6,>=4.4: 5.1.1 from /home/kevin/.local/lib/python2.7/site-packages
      backports-abc>=0.4: 0.5 from /home/kevin/.local/lib/python2.7/site-packages
      singledispatch: 3.4.0.3 from /home/kevin/.local/lib/python2.7/site-packages
        six: 1.13.0 from /home/kevin/.local/lib/python2.7/site-packages
      futures: 3.3.0 from /home/kevin/.local/lib/python2.7/site-packages
    requests>=2.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
      certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
      chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
      idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
      urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
    setuptools: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
  requests>=2.0.0: 2.22.0 from /home/kevin/.local/lib/python2.7/site-packages
    certifi>=2017.4.17: 2019.11.28 from /home/kevin/.local/lib/python2.7/site-packages
    chardet<3.1.0,>=3.0.2: 3.0.4 from /home/kevin/.local/lib/python2.7/site-packages
    idna<2.9,>=2.5: 2.8 from /home/kevin/.local/lib/python2.7/site-packages
    urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1: 1.25.7 from /home/kevin/.local/lib/python2.7/site-packages
  setuptools>=3.3: 44.0.0 from /home/kevin/.local/lib/python2.7/site-packages
GStreamer: 1.14.5.0 from /usr/lib/python2.7/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.26.1
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad

vs

kevin@linuxserver:/$ sudo mopidyctl deps
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
Executable: /usr/bin/mopidy
Platform: Linux-4.15.0-72-generic-x86_64-with-Ubuntu-18.04-bionic
Python: CPython 2.7.17 from /usr/lib/python2.7
Mopidy: 2.1.0 from /usr/lib/python2.7/dist-packages
Mopidy-Moped: 0.7.1 from /usr/local/lib/python2.7/dist-packages
  Mopidy>=1.0.0: 2.1.0 from /usr/lib/python2.7/dist-packages
  setuptools: 39.0.1 from /usr/lib/python2.7/dist-packages
Mopidy-Local-Images: 1.0.0 from /usr/local/lib/python2.7/dist-packages
  Mopidy>=1.1: 2.1.0 from /usr/lib/python2.7/dist-packages
  uritools>=1.0: 2.2.0 from /usr/local/lib/python2.7/dist-packages
    ipaddress; python_version == "2.7": 1.0.17 from /usr/lib/python2.7/dist-packages
  Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
  setuptools: 39.0.1 from /usr/lib/python2.7/dist-packages
Mopidy-Iris: 3.43.0 from /usr/local/lib/python2.7/dist-packages
  ConfigObj>=5.0.6: 5.0.6 from /usr/local/lib/python2.7/dist-packages
    six: 1.11.0 from /usr/lib/python2.7/dist-packages
  Mopidy-Local-Images>=1.0: 1.0.0 from /usr/local/lib/python2.7/dist-packages
    Mopidy>=1.1: 2.1.0 from /usr/lib/python2.7/dist-packages
    uritools>=1.0: 2.2.0 from /usr/local/lib/python2.7/dist-packages
      ipaddress; python_version == "2.7": 1.0.17 from /usr/lib/python2.7/dist-packages
    Pykka>=1.1: 1.2.1 from /usr/lib/python2.7/dist-packages
    setuptools: 39.0.1 from /usr/lib/python2.7/dist-packages
  Mopidy>=2.0: 2.1.0 from /usr/lib/python2.7/dist-packages
  requests>=2.0.0: 2.18.4 from /usr/lib/python2.7/dist-packages
  setuptools>=3.3: 39.0.1 from /usr/lib/python2.7/dist-packages
GStreamer: 1.14.5.0 from /usr/lib/python2.7/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.26.1
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad

Any help on this would be greatly appreciated. Thanks

For the service to see extensions they need to be installed globally, rather that installed under your user. You can do that with sudo pip install whatever.

Thanks - that was exactly it!