bgneal@4: Upgrading Trac on Windows Gotcha - Part 2 bgneal@4: ######################################### bgneal@4: bgneal@4: :date: 2012-03-21 20:10 bgneal@4: :tags: Python, Trac, Subversion, Windows bgneal@4: :slug: upgrading-trac-on-windows-gotcha-part-2 bgneal@4: :author: Brian Neal bgneal@4: bgneal@4: I have `previously reported`_ on some problems I had when upgrading our Trac_ bgneal@4: install at work. Today I attempted another upgrade to Subversion_ 1.7.4 and Trac bgneal@4: 0.12.3 on Windows. I upgraded to Python_ 2.7.2 along the way. I ran into another bgneal@4: problem with the Python bindings to Subversion which took a while to figure out. bgneal@4: I had no problems upgrading Subversion, but Trac could not see our repository. bgneal@4: The symptoms were that the Trac "timeline" and "browse source" features were bgneal@4: missing. bgneal@4: bgneal@4: Following the `Trac troubleshooting advice`_, I opened an interactive Python bgneal@4: session and tried this: bgneal@4: bgneal@4: :: bgneal@4: bgneal@4: E:\Trac_Data>python bgneal@4: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win bgneal@4: 32 bgneal@4: Type "help", "copyright", "credits" or "license" for more information. bgneal@4: >>> from svn import client bgneal@4: Traceback (most recent call last): bgneal@4: File "", line 1, in bgneal@4: File "C:\Python27\lib\site-packages\svn\client.py", line 26, in bgneal@4: from libsvn.client import * bgneal@4: File "C:\Python27\lib\site-packages\libsvn\client.py", line 25, in bgneal@4: _client = swig_import_helper() bgneal@4: File "C:\Python27\lib\site-packages\libsvn\client.py", line 21, in swig_import bgneal@4: _helper bgneal@4: _mod = imp.load_module('_client', fp, pathname, description) bgneal@4: ImportError: DLL load failed: The operating system cannot run %1 bgneal@4: bgneal@4: After some head scratching and googling I finally found the problem. I had used bgneal@4: the Windows .msi installer, `graciously provided by Alagazam`_, aka David Darj, bgneal@4: to install Subversion. This placed the Subversion binaries and DLL's in bgneal@4: ``C:\Program Files\Subversion\bin``. I then unzipped the Python 2.7 bindings to bgneal@4: the ``C:\Python27\Lib\site-packages`` folder. The bindings depend on the DLL's bgneal@4: in the ``Subversion\bin`` folder. But unfortunately for me, there were already bgneal@4: two older versions of the DLL's, ``libeay32.dll`` and ``ssleay32.dll`` on my bgneal@4: path. So when the bindings went looking for those two DLL's, instead of finding bgneal@4: them in ``Subversion\bin``, it found the older versions somewhere else. bgneal@4: bgneal@4: To fix this, you can either rearrange your path, or copy those two DLL's to your bgneal@4: ``Python27\Lib\site-packages\libsvn`` folder. In the future, I am going to just bgneal@4: copy all the DLL's from ``Subversion\bin`` to the ``libsvn`` folder. bgneal@4: bgneal@4: I examined the pre-built Subversion packages from Bitnami_ and CollabNet_. They bgneal@4: had packaged all of the Subversion DLL's with the Python bindings together in bgneal@4: the same directory, so this seems reasonable. Later, on the Subversion users' bgneal@4: mailing list, Alagazam gave the nod to this approach. bgneal@4: bgneal@4: A big thank you to Alagazam for the help and for the Windows binaries. And of bgneal@4: course thanks to the Apache_, Subversion_, Trac_, & Python_ teams for making bgneal@4: great tools. bgneal@4: bgneal@4: .. _previously reported: /2011/09/12/upgrading-trac-on-windows-gotchas bgneal@4: .. _Trac: http://trac.edgewall.org/ bgneal@4: .. _Subversion: http://subversion.apache.org/ bgneal@4: .. _Trac troubleshooting advice: http://trac.edgewall.org/wiki/TracSubversion#Checklist bgneal@4: .. _graciously provided by Alagazam: http://sourceforge.net/projects/win32svn/ bgneal@4: .. _Bitnami: http://bitnami.org/ bgneal@4: .. _CollabNet: http://www.collab.net/ bgneal@4: .. _Python: http://www.python.org/ bgneal@4: .. _Apache: http://subversion.apache.org/