Subversion python bindings could not be loaded Subversion python bindings could not be loaded python python

Subversion python bindings could not be loaded


I just wanted to bring the actual solution out of the comments to Alex Martelli's answer:

According to https://www.mercurial-scm.org/pipermail/mercurial/2009-May/026015.html the subversion bindings are included in tortoisehg. So you just need to enable the convert extension in tortoisehg. – tonfa

Ah ha! Another step forward. I changed my path to point at hg in TortoiseHG instead of Mercurial and this got over that hurdle. Now it just doesn't think the repository is an SVN one, ahh! – Paul

This worked for me as well.

If you're currently using the standard command line version of HG on Windows, the specific steps are:

  • Install TortoiseHG
  • Right click a file / TortoiseHG / Global Settings... / Extensions / {Check "convert"}
  • Make sure TortoiseHG is the path for your hg command:
    • WinKey+Pause / Advanced / Environment Variables / System Variables / Path
    • REMOVE C:\Program Files\Mercurial from the path
    • Make sure C:\Program Files\TortoiseHG is there


The problem's explained here at heading "Converting from Subversion":

Subversion's Python bindings are a prerequisite. The bindings (generated with SWIG) are installed separately on Windows, and can be found on http://subversion.tigris.org/ . Note that you can't do this with the Win32 Mercurial binaries -- there's no way to install the Subversion bindings into its built-in Python library. So you'll need to use a Mercurial installed on top of a stand-alone Python, and you may also need to do something like "set HG=python c:\Python25\Scripts\hg" to override the default Win32 binaries if you have those installed also. For Mac OS X, the easiest way is to install the CollabNet Subversion build, and then copy the content of /opt/subversion/lib/svn-python to the site-package directory of the python installation.

Unfortunately hg + svn + win doesn't apparently get any easier with hgsubversion, at least judging from this post and this discussion thereof (I have no Windows installed to try and help out, sigh).


sudo apt-get install python-subversion

did the trick for me on Ubuntu.