Hgsubversion bindings errors on Mountain Lion and above
Problem
Environment specific: Mac OS X 10.8 (Mountain Lion)
When trying to clone from Subversion to Mercurial, or use a repository via hgsubversion, the following error is displayed:
abort: no compatible bindings available:
Subversion 1.5.0 or later required, but no bindings were found
Subvertpy 0.7.4 or later required, but not found
Please install either Subvertpy or the Subversion Python SWIG bindings!
Cause
Mac OS X 10.8 (Mountain Lion) and later versions no longer come pre-installed with the Python/Subversion bindings required by hgsubversion.
If on Mac OS X 10.10 (Yosemite), some dependencies for hgsubversion are built using the wrong architecture in order to work on Yosemite, so you must build them yourself.
Resolution
The easiest way to install the bindings is as follows:
- Install Homebrew from http://brew.sh/
Type the following command to install Homebrew's Subversion and Python bindings:
$ brew install --with-python subversion
This will take a little while
Yosemite Users
SourceTree for Mac 2.0.5 contains an updated hgsubversion extension, but you may still have to follow the below steps to get it working.
If the second step's command doesn't work and you're on Yosemite, see the following links:
https://github.com/Homebrew/homebrew/issues/36301
https://github.com/Homebrew/homebrew/issues/35744
https://github.com/Homebrew/homebrew/issues/34119Depending on your environment, you may have to perform some of the commands noted. Typically you have to run '
brew update
' first, then 'brew reinstall apr --universal
', 'brew reinstall apr-util --universal
', and only then 'brew install --with-python subversion
'. This should then be followed by step 3 below. Running the previous commands should yield no errors, if it does, see the comments in the linked GitHub issues.Add the bindings to your Python setup.
$ sudo sh -c 'echo /usr/local/lib/svn-python > /Library/Python/2.7/site-packages/subversion.pth'
This makes your Python install look in /usr/local/lib/svn-python for libraries which is where the bindings are
Your hgsubversion clones should now be working again, both in SourceTree and on the command line.
See also: git-svn problems on Mountain Lion