Having trouble running Mopidy on Raspbian Jessie

Hi there,

I have installed mopidy for Jessie as instructed on the website. Install gave no errors. On running mopidy I get the following error. Any ideas on where to start?

pi@raspberrypi:~ $ mopidy
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 9, in
load_entry_point(‘Mopidy==2.0.1’, ‘console_scripts’, ‘mopidy’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2190, in load
[‘name’])
File “/usr/lib/python2.7/dist-packages/mopidy/main.py”, line 8, in
from mopidy.internal.gi import Gst # noqa: F401
File “/usr/lib/python2.7/dist-packages/mopidy/internal/gi.py”, line 9, in
gi.require_version(‘Gst’, ‘1.0’)
AttributeError: ‘module’ object has no attribute ‘require_version’

Any help greatly appreciated :slight_smile:

Please provide the output of mopidy deps .

Modpidy deps gives me the same error:

mopidy deps
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 9, in
load_entry_point(‘Mopidy==2.0.1’, ‘console_scripts’, ‘mopidy’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2190, in load
[‘name’])
File “/usr/lib/python2.7/dist-packages/mopidy/main.py”, line 8, in
from mopidy.internal.gi import Gst # noqa: F401
File “/usr/lib/python2.7/dist-packages/mopidy/internal/gi.py”, line 9, in
gi.require_version(‘Gst’, ‘1.0’)
AttributeError: ‘module’ object has no attribute ‘require_version’

I’ve tried reinstalling pip and python, for the same result.

I literally just did this on the very latest (September) Raspbian image. Exactly which instructions did you follow, https://docs.mopidy.com/en/latest/installation/debian/ ? Could you paste the output of:

  • ls -l /usr/lib/python2.7/dist-packages/gi.
  • cat /etc/apt/sources.list.d/mopidy.list

Yes, those were the instructions I used.

Here’s what I get for those commands:

 pi@raspberrypi:~ $ ls -l /usr/lib/python2.7/dist-packages/gi
 total 464
 -rw-r--r-- 1 root root   2078 Sep 29  2014 _constants.py
 -rw-r--r-- 1 root root   1310 May 10 23:32 _constants.pyc
 -rw-r--r-- 1 root root   6688 Sep 29  2014 docstring.py
 -rw-r--r-- 1 root root   4953 May 10 23:32 docstring.pyc
 -rw-r--r-- 1 root root   2080 Sep 29  2014 _error.py
 -rw-r--r-- 1 root root   1782 May 10 23:32 _error.pyc
 -rw-r--r-- 1 root root 251484 Sep 29  2014 _gi.so
 drwxr-xr-x 2 root root   4096 Jan  1  1970 _gobject
 -rw-r--r-- 1 root root   2163 Sep 29  2014 importer.py
 -rw-r--r-- 1 root root   1641 May 10 23:32 importer.pyc
 -rw-r--r-- 1 root root   4550 Sep 29  2014 __init__.py
 -rw-r--r-- 1 root root   3970 May 10 23:32 __init__.pyc
 -rw-r--r-- 1 root root  12784 Sep 29  2014 module.py
 -rw-r--r-- 1 root root   9122 May 10 23:32 module.pyc
 -rw-r--r-- 1 root root  13249 Sep 29  2014 _option.py
 -rw-r--r-- 1 root root  12710 May 10 23:32 _option.pyc
 drwxr-xr-x 2 root root   4096 Oct  5 11:15 overrides
 -rw-r--r-- 1 root root  15175 Sep 29  2014 _propertyhelper.py
 -rw-r--r-- 1 root root  12859 May 10 23:32 _propertyhelper.pyc
 -rw-r--r-- 1 root root    766 Sep 29  2014 pygtkcompat.py
 -rw-r--r-- 1 root root    752 May 10 23:32 pygtkcompat.pyc
 drwxr-xr-x 2 root root   4096 Jan  1  1970 repository
 -rw-r--r-- 1 root root   9776 Sep 29  2014 _signalhelper.py
 -rw-r--r-- 1 root root   9676 May 10 23:32 _signalhelper.pyc
 -rw-r--r-- 1 root root  13565 Sep 29  2014 types.py
 -rw-r--r-- 1 root root   9536 May 10 23:32 types.pyc
 pi@raspberrypi:~ $ cat /etc/apt/sources.list.d/mopidy.list
 # Mopidy APT archive
 # Built on Debian 8 (jessie), compatible with Ubuntu 14.04 LTS and 15.04
 deb http://apt.mopidy.com/ jessie main contrib non-free
 deb-src http://apt.mopidy.com/ jessie main contrib non-free

Thanks

Could you try reinstalling python-gi? sudo apt-get install python-gi --reinstall

I’ve reinstalled python gi and mopidy gives the same error:

pi@raspberrypi:~ $ sudo apt-get install python-gi --reinstall
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
python-colorama python-distlib python-html5lib python-wheel
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 6 not upgraded.
Need to get 475 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 Index of /raspbian jessie/main python-gi armhf 3.14.0-1 [475 kB]
Fetched 475 kB in 1s (333 kB/s)
(Reading database … 126350 files and directories currently installed.)
Preparing to unpack …/python-gi_3.14.0-1_armhf.deb …
Unpacking python-gi (3.14.0-1) over (3.14.0-1) …
Setting up python-gi (3.14.0-1) …
pi@raspberrypi:~ $ mopidy
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 9, in
load_entry_point(‘Mopidy==2.0.1’, ‘console_scripts’, ‘mopidy’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2190, in load
[‘name’])
File “/usr/lib/python2.7/dist-packages/mopidy/main.py”, line 8, in
from mopidy.internal.gi import Gst # noqa: F401
File “/usr/lib/python2.7/dist-packages/mopidy/internal/gi.py”, line 9, in
gi.require_version(‘Gst’, ‘1.0’)
AttributeError: ‘module’ object has no attribute ‘require_version’

I then tried reinstalling mopidy, and the same error persists:

pi@raspberrypi:~ $ sudo apt-get install mopidy --reinstall
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
python-colorama python-distlib python-html5lib python-wheel
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 6 not upgraded.
Need to get 0 B/204 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages …
(Reading database … 126350 files and directories currently installed.)
Preparing to unpack …/mopidy_2.0.1-1_all.deb …
Unpacking mopidy (2.0.1-1) over (2.0.1-1) …
Processing triggers for gnome-menus (3.13.3-6) …
Processing triggers for desktop-file-utils (0.22-1) …
Processing triggers for mime-support (3.58) …
Processing triggers for man-db (2.7.0.2-5) …
Processing triggers for systemd (215-17+deb8u5) …
Setting up mopidy (2.0.1-1) …
insserv: warning: current start runlevel(s) (empty) of script mopidy' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mopidy’ overrides LSB defaults (0 1 6).
insserv: warning: current start runlevel(s) (empty) of script mopidy' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script mopidy’ overrides LSB defaults (0 1 6).
pi@raspberrypi:~ $ mopidy
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 9, in
load_entry_point(‘Mopidy==2.0.1’, ‘console_scripts’, ‘mopidy’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2476, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2190, in load
[‘name’])
File “/usr/lib/python2.7/dist-packages/mopidy/main.py”, line 8, in
from mopidy.internal.gi import Gst # noqa: F401
File “/usr/lib/python2.7/dist-packages/mopidy/internal/gi.py”, line 9, in
gi.require_version(‘Gst’, ‘1.0’)
AttributeError: ‘module’ object has no attribute ‘require_version’
pi@raspberrypi:~ $

Tried again with a fresh install of Jessie, and it worked first time.
Must have had some corrupt python files.

Thanks for your help anyway.