nautilus-python fails to load on 64-bit systems: g_module_open libpython failed: No such file or directory

Reported by Adam Dingle on 2013-04-17
This bug affects 45 people
Affects Status Importance Assigned to Milestone
nautilus-python (Debian)
Fix Released
nautilus-python (Ubuntu)
Barry Warsaw

Bug Description

I'm running Ubuntu 13.04 (Raring). To see the problem, do these steps on a 64-bit system:

1. Install the python-nautilus package.
2. Install any extension that uses nautilus-python, e.g. the rabbitvcs-nautilus package.
3. From a terminal window, run 'nautilus -q' to exit Nautilus, then run 'nautilus' to start it again.

You'll see this:

(nautilus:3810): Nautilus-Python-WARNING **: g_module_open libpython failed: /usr/lib/libpython2.7.so.1.0: cannot open shared object file: No such file or directory
ImportError: could not import gobject (error was: '/usr/lib/x86_64-linux-gnu/libpyglib-gi-2.0-python2.7.so.0: undefined symbol: _Py_ZeroStruct')

(nautilus:3810): Nautilus-Python-WARNING **: pygobject initialization failed

And of course then the extension will not work.

The problem is that nautilus-python is looking for libpython2.7.so in /usr/lib, but on this system it lives in /usr/lib/x86_64-linux-gnu/. The nautilus-python sources have a macro in m4/python.m4 which attempts to detect a 64-bit library directory at build time, but it fails on Ubuntu because it only recognizes such directories if their names end in "lib64".

Adam Dingle (adam-yorba) wrote :

When building from source, you can work around this by configuring like this:

$ ./configure PYTHON_LIB_LOC=/usr/lib/x86_64-linux-gnu

Changed in nautilus-python:
importance: Unknown → Medium
status: Unknown → New
gervin23 (gervin23) wrote :

confirmed here on 64bit machine in 13.04

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nautilus-python (Ubuntu):
status: New → Confirmed
Hồng Quân (ng-hong-quan) wrote :

To workaround, make symbolic link /usr/lib/libpython2.7.so.1.0 pointing to /usr/lib/x86_64-linux-gnu/libpython2.7.so

Doug McMahon (mc3man) wrote :

Don't have a 32 bit install but would it not also be affected as filelist for libpython2.7 shows -

Dr. Amr Osman (dr3mro) wrote :

Description: allows nautilus-python to work in 13.04 amd64 but I know nothing about m4's
this is a working patch i have got from a friend online
not my patch
it solves the issue
i have made a deb on ppa:nae-team/ppa

The attachment "m4-test.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Doug McMahon (mc3man) wrote :

Went ahead & did a 32 bit 13.04 install & like I previously mentioned it is also affected in same manner.
In this case no clue as the python.m4 says if not amd64 it will use the default of /lib, where that is set no idea
(doesn't seem to be in python.m4, maybe in lib-prefix.m4??

In any event for amd64 it is fixed either with a symlink, a DEB_CONFIGURE_EXTRA_FLAGS for local amd64 build or the .m4 patch

Really needs to be properly fixed though interest in seems quite low

Barry Warsaw (barry) wrote :

I've adapted the patch in comment #6 by Dr. Amr Osman (dr3mro). Built and tested locally on saucy and it seemed to work for me, so I uploaded it. Thanks!

Changed in nautilus-python (Ubuntu):
assignee: nobody → Barry Warsaw (barry)
status: Confirmed → In Progress

On 05/28/2013 04:38 PM, Barry Warsaw wrote:
> I've adapted the patch in comment #6 by Dr. Amr Osman (dr3mro). Built
> and tested locally on saucy and it seemed to work for me, so I uploaded
> it. Thanks!
> ** Changed in: nautilus-python (Ubuntu)
> Assignee: (unassigned) => Barry Warsaw (barry)
> ** Changed in: nautilus-python (Ubuntu)
> Status: Confirmed => In Progress
Did you test it on an i386 install?

Doug McMahon (mc3man) wrote :

I tried your diff on i386 - no go as seen during build -
-DPYTHON_VERSION=\"2.7\" -DPY_LIB_LOC="\"/usr/lib\"" -I/usr/include/python2.7 -I/usr/include/i386-linux-gnu/python2.7

so I modified my orig. patch to work on both i386 & amd_64, though as mentioned know nothing about m4 & such - just some logical T&E

Doug McMahon (mc3man) wrote :

More in line with how Barry did though still separate patch

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nautilus-python - 1.1-3ubuntu2

nautilus-python (1.1-3ubuntu2) saucy; urgency=low

  [ Dr.Amr Osman ]
  * debian/patches/02_python_multiarch_path.patch: Add 64bit multiarch
    search paths for libpython2.7.so. (LP: #1170017)
 -- Barry Warsaw <email address hidden> Tue, 28 May 2013 16:26:27 -0400

Changed in nautilus-python (Ubuntu):
status: In Progress → Fix Released
Doug McMahon (mc3man) wrote :
Barry Warsaw (barry) wrote :

Thanks Doug. I've applied your patch and uploaded to 1.1-3ubuntu3. Tested on both amd64 and i386.

When will the fix be released for raring?

Luke Faraone (lfaraone) on 2013-07-10
Changed in nautilus-python (Ubuntu Raring):
status: New → Triaged
Doug McMahon (mc3man) wrote :

Until such time that this is fixed in 13.04 I left a testing ppa up with raring packages
(basically the same as the saucy fix except done as an additional patch

Changed in nautilus-python (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.