Mopidy Discourse

Mopidy fails with PyGObject

Since today I can’t start mopidy on my mac anymore (don’t exactly know what I changed since yesterday).
It says "ImportError: cannot import name _gi".
I already googled and tried every possible solution for 3h or so.
So I am quite desperate, and hope you are so kind and can help!

When I use brew to re-install mopidy it fails with:
Mopidy install fails on gst-python@2 dependency https://github.com/mopidy/homebrew-mopidy/issues/35
I tried to install gst-python@2 using brew install gst-python --with-python2 but this fails with Error: invalid option: --with-python2
I also tried to install pygobject which also fails.
Working: python3 --> import gi
Doesn’t work: python --> import gi --> cannot import name _gi

I also manually copied the gi folder from python3.7/site-packages to python2.7/site-packages. But it doesn’t help :frowning:

Installing Mopidy 2.x on Python 2.7 with Homebrew have been broken for the last year. However, we’ve just released Mopidy 3 running on Python 3.7. The Homebrew tap is up to date, and regular brew update; brew upgrade should upgrade to Mopidy 3.0 for you.

1 Like

Thanks! Yes it works.
Btw, yesterday a similar problem showed up: AttributeError: module 'gi' has no attribute 'require_version' when running mopidy.
I could resolve it by installing the pyobject manually with brew: brew install pygobject3
The issue was caused by installing mopidy-youtube via pip (not available through brew): python3 -m pip install Mopidy-Youtube

Maybe this helps smbd else.

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