bzr info crashes on MacOS X 10.9. ERROR: exceptions.ImportError

Bug #1244668 reported by Alex Mitchell on 2013-10-25
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar
Undecided
Unassigned
Bazaar Mac Installers
Undecided
Unassigned

Bug Description

Running "bzr info" crashes after upgrading to MacOS X 10.9. I reinstalled bzr, and also installed XCode command line tools (as suggested here https://bugs.launchpad.net/bzr-mac-installers/+bug/1061330 for the same bug on 10.8), but no luck. It seems that subversion was still not installed after installing the command line tools. Any ideas how to get the appropriate extensions installed?

alex-macbook-2:hypedyn cnmmai$ bzr info
bzr: ERROR: exceptions.ImportError: Unable to load subvertpy extensions: dlopen(/Library/Python/2.6/site-packages/subvertpy/client.so, 2): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
  Referenced from: /Library/Python/2.6/site-packages/subvertpy/client.so
  Reason: image not found

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 1138, in ignore_pipe
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/builtins.py", line 1853, in run
    verbose=noise_level, outfile=self.outf)
  File "/Library/Python/2.6/site-packages/bzrlib/info.py", line 378, in show_bzrdir_info
    outfile)
  File "/Library/Python/2.6/site-packages/bzrlib/info.py", line 394, in show_component_info
    format = describe_format(control, repository, branch, working)
  File "/Library/Python/2.6/site-packages/bzrlib/info.py", line 499, in describe_format
    format = controldir.format_registry.make_bzrdir(key)
  File "/Library/Python/2.6/site-packages/bzrlib/controldir.py", line 1348, in make_bzrdir
    return self.get(key)()
  File "/Library/Python/2.6/site-packages/bzrlib/registry.py", line 177, in get
    return self._dict[self._get_key_or_default(key)].get_obj()
  File "/Library/Python/2.6/site-packages/bzrlib/registry.py", line 74, in get_obj
    self._obj = get_named_object(self._module_name, self._member_name)
  File "/Library/Python/2.6/site-packages/bzrlib/pyutils.py", line 51, in get_named_object
    obj = __import__(module_name, {}, {}, from_list)
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/svn/workingtree.py", line 28, in <module>
    import subvertpy
  File "/Library/Python/2.6/site-packages/subvertpy/__init__.py", line 131, in <module>
    raise ImportError("Unable to load subvertpy extensions: %s" % e)
ImportError: Unable to load subvertpy extensions: dlopen(/Library/Python/2.6/site-packages/subvertpy/client.so, 2): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
  Referenced from: /Library/Python/2.6/site-packages/subvertpy/client.so
  Reason: image not found

bzr 2.6.0 on python 2.6.8 (Darwin-13.0.0-x86_64-i386-64bit)
arguments: ['/usr/local/bin/bzr', 'info']
plugins: bash_completion[2.6.0], bzrtools[2.5.0], changelog_merge[2.6.0],
    colo[0.4.0], email[unknown], explorer[1.3.0], fastimport[0.14.0dev],
    git[0.6.11], grep[2.6.0], keychain[0.1.0], launchpad[2.6.0], loom[2.2.0],
    netrc_credential_store[2.6.0], news_merge[2.6.0], pipeline[1.4.0],
    po_merge[2.6.0], qbzr[0.23.1], rewrite[0.6.3], svn[1.2.2], upload[1.1.0],
    weave_fmt[2.6.0], xmloutput[0.8.8]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_GB.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Vincent Ladeuil (vila) on 2013-10-26
affects: bzr → bzr-mac-installers
Daniel Conde (dpfconde) wrote :

The problem is, Mavericks command line tools libraries are set on /Library/Developer/CommandLineTools/usr/lib/ instead of /usr/lib. This causes bazaar to fail the load of the needed svn libraries because they are not available in /usr/lib.

The fix for this is to just link the necessary libraries from /Library/Developer/CommandLineTools/usr/lib to /usr/lib like this:
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_client-1.0.dylib /usr/lib/libsvn_client-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_subr-1.0.dylib /usr/lib/libsvn_subr-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_ra-1.0.dylib /usr/lib/libsvn_ra-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_wc-1.0.dylib /usr/lib/libsvn_subr-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_wc-1.0.dylib /usr/lib/libsvn_wc-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_diff-1.0.dylib /usr/lib/libsvn_diff-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_ra_local-1.0.dylib /usr/lib/libsvn_ra_local-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_repos-1.0.dylib /usr/lib/libsvn_repos-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_fs-1.0.dylib /usr/lib/libsvn_fs-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_fs_fs-1.0.dylib /usr/lib/libsvn_fs_fs-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_fs_util-1.0.dylib /usr/lib/libsvn_fs_util-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_ra_svn-1.0.dylib /usr/lib/libsvn_ra_svn-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_ra_neon-1.0.dylib /usr/lib/libsvn_ra_neon-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libneon.27.dylib /usr/lib/libneon.27.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_ra_serf-1.0.dylib /usr/lib/libsvn_ra_serf-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libserf-1.0.dylib /usr/lib/libserf-1.0.dylib
sudo ln -s /Library/Developer/CommandLineTools/usr/lib/libsvn_delta-1.0.dylib /usr/lib/libsvn_delta-1.0.dylib

Gordon Tyler (doxxx) wrote :

Once you've linked those libraries into /usr/lib, do bzr svn operations work correctly? I've been told by the author of bzr-svn that it is only compatible with svn 1.6 but OS X Mavericks has svn 1.7 installed.

Alex Mitchell (alexm-nus) wrote :

That seems to work, thanks! At least it solves the specific problem I reported above related to "bzr info". I haven't tried any bzr svn operations.

This work for me.
Thanks you

I executed
ln -s /Library/Developer/CommandLineTools/usr/lib/*.dylib /usr/lib/

Chamod (chamod) wrote :

Thanks. I'm running Xcode 6.1 on Yosemite, so I had to make a small change.

sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/* /usr/lib

Andrew Johnson (anj) wrote :

This workaround doesn't work for me on El Capitan, I get "Operation not permitted" errors from ln due to Apple's System Integrity Protection. I tried putting the soft links into /usr/local/lib, no joy, nor do they work in the /Library/Python/2.6/site-packages/subvertpy/ directory (where the client.so library that is trying to link to them is placed). It's a real pain to have to disable SIP just to do this, and I'm guessing that our sysadmins wouldn't be too happy about it.

Download full text (4.0 KiB)

This happens on Mac OS X Sierra also (workaround by Chamod works if you disable SIP):

$ bzr version-info --check-clean
/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/osutils.py:1104: RuntimeWarning: compiletime version 2.7 of module 'bzrlib._chunks_to_lines_pyx' does not match runtime version 2.6
  from bzrlib._chunks_to_lines_pyx import chunks_to_lines
bzr 2.7.0 is too new for pipeline 1.4
/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/rio.py:378: RuntimeWarning: compiletime version 2.7 of module 'bzrlib._rio_pyx' does not match runtime version 2.6
  from bzrlib._rio_pyx import (
/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/chk_map.py:1728: RuntimeWarning: compiletime version 2.7 of module 'bzrlib._chk_map_pyx' does not match runtime version 2.6
  from bzrlib._chk_map_pyx import (
bzr: ERROR: exceptions.ImportError: Unable to load subvertpy extensions: dlopen(/Library/Python/2.6/site-packages/subvertpy/client.so, 2): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
  Referenced from: /Library/Python/2.6/site-packages/subvertpy/client.so
  Reason: image not found

Traceback (most recent call last):
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/cmd_version_info.py", line 138, in run
    builder.generate(self.outf)
  File "/usr/local/Cellar/bazaar/2.7.0/libexec/bzrlib/version_info_formats/format_rio.py", line 45, in generate
    hook(rev, info)
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/svn/__init__.py", line 424, in update_stanza
    (uuid, branch_path, revno) = extract_svn_foreign_revid(rev)
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/svn/__init__.py", line 410, in extract_svn_foreign_revid
    from bzrlib.plugins.svn.mapping import mapping_registry
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/svn/mapping.py", line 23, in <module>
    from subvertpy import properties
  File "/Library/Python/2.6/site-packages/subvertpy/__init__.py", line 131, in <module>
    raise ImportError("Unable to load subvertpy extensions: %s" % e)
ImportError: Unable to load subvertpy extensions: dlopen(/Library/Python/2.6/site-packages/subvertpy/client.so, 2): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
  Referenced from: /Library/Python/2.6/site-packages/subvertpy/client.so
  Reason: image not found

bzr 2.7.0 on python 2.6.9 (Darwin-16.3.0-x86_64-i386-64bit)
arguments: ['/usr/local/Cellar/bazaar/2.7.0/libexec/bzr', ...

Read more...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers