Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named gi.repository

I'm trying to launch python script on Ubuntu 10.04:

from gi.repository import Nautilus, GObject

It doesn't work:

Traceback (most recent call last):
  File "script.py", line 1, in <module>
    from gi.repository import Nautilus, GObject
   ImportError: No module named gi.repository

I installed python-gobject-dev, python-gobject, python-nautilus, but it didn't help. Has anyone had this problem?

like image 553
user3617166 Avatar asked May 08 '14 15:05

user3617166


2 Answers

@hob's answer for Anaconda didn't work for me, but conda install -c conda-forge pygobject did.

like image 190
crypdick Avatar answered Nov 17 '22 18:11

crypdick


Try to fix it by installing PyGObject:

# With Apt on Ubuntu:
$ sudo apt install python3-gi

# With Yum on CentOS / RHEL:
$ sudo yum install python36-gobject.x86_64 

# Or directly with Pip:
$ pip3 install PyGObject  
like image 10
Noam Manos Avatar answered Nov 17 '22 19:11

Noam Manos