masmu / pulseaudio-dlna

A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux
GNU General Public License v3.0
1.25k stars 162 forks source link

ImportError: No module named gi.repository #392

Open gene1wood opened 4 years ago

gene1wood commented 4 years ago

Steps to reproduce

virtualenv -p python2.7 ~/venv
~/venv/bin/python ./setup.py install
~/venv/bin/pulseaudio-dlna 

Result

Traceback (most recent call last):
  File "/home/jdoe/venv/pulseaudio-dlna/bin/pulseaudio-dlna", line 11, in <module>
    load_entry_point('pulseaudio-dlna==0.5.2', 'console_scripts', 'pulseaudio-dlna')()
  File "/home/jdoe/venv/pulseaudio-dlna/local/lib/python2.7/site-packages/pulseaudio_dlna-0.5.2-py2.7.egg/pulseaudio_dlna/__main__.py", line 157, in main
    import pulseaudio_dlna.application
  File "/home/jdoe/venv/pulseaudio-dlna/local/lib/python2.7/site-packages/pulseaudio_dlna-0.5.2-py2.7.egg/pulseaudio_dlna/application.py", line 31, in <module>
    import pulseaudio_dlna.plugins.dlna
  File "/home/jdoe/venv/pulseaudio-dlna/local/lib/python2.7/site-packages/pulseaudio_dlna-0.5.2-py2.7.egg/pulseaudio_dlna/plugins/dlna/__init__.py", line 26, in <module>
    import pulseaudio_dlna.plugins.dlna.ssdp.listener
  File "/home/jdoe/venv/pulseaudio-dlna/local/lib/python2.7/site-packages/pulseaudio_dlna-0.5.2-py2.7.egg/pulseaudio_dlna/plugins/dlna/ssdp/listener.py", line 20, in <module>
    from gi.repository import GObject
ImportError: No module named gi.repository

Possible Cause

I suspect this is because #253 didn't add PyGObject as a dependent pypi package

Partial Workaround

In trying to workaround this, I also found that in order to install PyGObject on Ubuntu 18.04 I had to do the following in response to errors during ~/venv/bin/pip install PyGObject

Cairo

Error : No package 'cairo' found

Solution : sudo apt install libcairo2-dev

gobject-introspection-1.0

Error : Package gobject-introspection-1.0 was not found in the pkg-config search path

Solution : sudo apt install libgirepository1.0-dev