Where should the scripts go for Nautilus Python 1.0?

Emilien Klein emilien at klein.st
Wed Sep 21 08:13:41 UTC 2011

To: Nautilus List at Gnome.org and Ubuntu Developers

Hey Nautilus-Python developers,

I have created a Nautilus extension [0] and packaged it for Debian
where it is available in Testing [1] (and works fine there). Debian
Testing is using version 0.6.1 of Nautilus-Python (together with Gnome
2.X). In that environment, my Python script that acts as the Nautilus
extension is placed in the following directory:

Now the same version as what's in Debian Testing is now available in
the latest development version of Ubuntu (11.10). That distro is using
version 1.0 of Nautilus-Python, together with Gnome 3.X. In that
environment, my Nautilus extension script gets placed in:

(that path is what's returned by a call to `pkg-config
--variable=pythondir nautilus-python` in my package's ./setup.py [2])

In Ubuntu 11.10, the extension is not visible [3] in Nautilus. It
seems that Nautilus-Python is looking at other directories to load the
extension, as I've found various references (in NP's README [4] file
and on the Internet) about directories such as
"/usr/share/nautilus-python/extensions". When I manually place my
script in that location and start Nautilus from the command line, I
see an Exception about the module nautilus not being defined (can't
paste because I have no access to my dev machine right now - could
provide it later if requested). The NEWS [5] file also mentions not
looking in the old "2.0" folders, but it is unclear to me if the new
"3.0" folder gets looked at or not...

I've also tried to install various other Nautilus extensions written
in Python (such as nautilus-bzr and nautilus-pastebin) in Ubuntu
11.10, and all failed displaying their extension in Nautilus. I am
thus guessing that something got changed in the way Nautilus-Python
loads the extension scripts between 0.6.1 and 1.0 (as specified in the
README), and that most [all?] Nautilus extensions written in Python
are broke on Ubuntu 11.10 (and maybe other distributions using NP >=

So my question is the following:
In Nautilus-Python 1.0, where should the Python script go that loads
the extension? How can this programatically be detected (that is, from
a setup.py script, how can the package know where to install itself
depending on the version of NP or Gnome, since the pkg-config call is
apparently not working anymore?)

Thanks a lot,

P.S.: Please CC me on your response since I'm not subscribe to this list.
FYI: I was testing using Ubuntu 11.10 beta 1 in VirtualBox.

[0] https://launchpad.net/nautilus-image-manipulator
[1] http://packages.qa.debian.org/n/nautilus-image-manipulator.html
[2] http://bazaar.launchpad.net/~emilien-klein/nautilus-image-manipulator/trunk/view/91/setup.py#L63
[3] https://bugs.launchpad.net/ubuntu/+source/nautilus-image-manipulator/+bug/849361
[4] http://git.gnome.org/browse/nautilus-python/tree/README?id=97b10dfe81e6573597a54fe52a5b8f851b37c022
[5] http://git.gnome.org/browse/nautilus-python/tree/NEWS?id=97b10dfe81e6573597a54fe52a5b8f851b37c022

More information about the Ubuntu-devel-discuss mailing list