Comment 0 for bug 858925

Emilien Klein (emilien-klein) wrote :

- Install Python-Nautilus in Ubuntu 11.10 (beta2 in my case)

- Create the [0] from the nautilus-python Reference Manual and put it in the ~/.local/share/nautilus-python/extensions folder (as per the RM's instructions)

- Restart Nautilus: `killall nautilus` and `nautilus --no-desktop`.

The following Exceptions will apprear in your terminal, and no Nautilus extension will appear:

emilien@ubuntu1110b2:~$ nautilus --no-desktop
** (nautilus:6258): DEBUG: Syncdaemon not running, waiting for it to start in NameOwnerChanged
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gi/", line 23, in <module>
    from ._gi import _API, Repository
ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',))

(nautilus:6258): Nautilus-Python-WARNING **: nautilus_python_init_python failed
Traceback (most recent call last):
  File "/home/emilien/.local/share/nautilus-python/extensions/", line 2, in <module>
    from gi.repository import GObject
  File "/usr/lib/python2.7/dist-packages/gi/", line 23, in <module>
    from ._gi import _API, Repository
ImportError: cannot import name _API

It is thus not possible to create a Nautilus extension using Python starting with Ubuntu 11.10. I came to this conclusion while trying to fix Bug #849361. Please give directions on how to build such an extension from Python, using Nautilus-Python 1.0.