Mopidy cannot find gstreamer, even though installed per instructions

I’m running Gentoo on a Raspberry Pi, and all dependencies have been installed per the install instructions.

I’m running inside a virtual environment to keep it from stepping on system installs, and when I do run it, I get the following:

((mopidy) ) digitech ~/mopidy # mopidy
/root/mopidy/lib/python3.12/site-packages/mopidy/init.py:5: UserWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 80.9.0 documentation. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources

ERROR: A GObject based library was not found.

Mopidy requires GStreamer to work. GStreamer is a C library with a
number of dependencies itself, and cannot be installed with the regular
Python tools like pip.

Please see Installation — Mopidy 4.0.0a5.dev16+g149e8af documentation for
instructions on how to install the required dependencies.

Traceback (most recent call last):
File “/root/mopidy/bin/mopidy”, line 5, in
from mopidy.main import main
File “/root/mopidy/lib/python3.12/site-packages/mopidy/main.py”, line 7, in
from mopidy import commands
File “/root/mopidy/lib/python3.12/site-packages/mopidy/commands.py”, line 18, in
from mopidy.audio import Audio
File “/root/mopidy/lib/python3.12/site-packages/mopidy/audio/init.py”, line 2, in
from .actor import Audio
File “/root/mopidy/lib/python3.12/site-packages/mopidy/audio/actor.py”, line 8, in
from mopidy.audio import tags as tags_lib
File “/root/mopidy/lib/python3.12/site-packages/mopidy/audio/tags.py”, line 7, in
from mopidy.internal.gi import GLib, Gst
File “/root/mopidy/lib/python3.12/site-packages/mopidy/internal/gi.py”, line 5, in
import gi
ModuleNotFoundError: No module named ‘gi’

But the packages are there:
dev-python/gst-python-1.24.11
media-libs/gst-plugins-base-1.24.11
media-libs/gst-plugins-good-1.24.11
media-libs/gst-plugins-ugly-1.24.11
media-libs/gstreamer-1.24.11
media-plugins/gst-plugins-meta-1.24.11
media-plugins/gst-plugins-mpeg2dec-1.24.11
media-plugins/gst-plugins-mpg123-1.24.11
dev-libs/gobject-introspection-1.82.0-r2

Thoughts?

What does “there” mean here? Also AFAIU the list you produce isn’t about Python packages, but the error is that a Python module is missing… The error is explicit: There’s no gi module in the virtual environment.

One easy solution is to install the corresponding operating system package and activate the include-system-site-packages at creation of the virtual environment, so that system packages are found by the virtual environment Python interpreter as fallback.

Under a Debian host:

$ sudo apt install -y python3-gi
$ python -m venv --sitem-site-packages mopidy-env

An alternative is to install the Python package in the virtual environment but unless it’s available as a “wheel” matching your Python interpreter, libc version, processor architecture, etc. prepare to have to compile a lot of things…

I found that suggestion re: that include in another thread regarding a different Python issue, and I’m trying that.

Hopefully it will see gstreamer now.

It did, all good. This can be closed.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.