ImportError: No module named svn

Posted by Kirby Turner on September 4, 2008

Recently I moved my CVS and Subversion repositories to a VPS that is running the server edition of Ubuntu Hardy. As part of the move I installed ViewCV enabling me to view my repositories via a web browser. Problem was when I viewed a Subversion repository I got the following error message:


An Exception Has Occurred
Python Traceback
Traceback (most recent call last):
File "/usr/local/viewcvs-1.0-dev/lib/viewcvs.py", line 3194, in main
request.run_viewcvs()
File "/usr/local/viewcvs-1.0-dev/lib/viewcvs.py", line 258, in run_viewcvs
import vclib.svn
File "/usr/local/viewcvs-1.0-dev/lib/vclib/svn/__init__.py", line 27, in ?
from svn import fs, repos, core, delta
ImportError: No module named svn


I could view CVS repository just not Subversion repositories. This left me scratching my head. I did a couple of google searches but no solution found. Then I thought to myself, “I wonder if there is anything Python specific for Subversion.” This prompted me to try searching for packages using the aptitude command.

Sure enough the command aptitude search subversion returned a few items including python-subversion, which is the Python binding for Subversion. Bingo! I ran the command aptitude install python-subversion then checked ViewCV again in my browser. Error gone. I’m now able to view both CVS and SVN repositories.


Posted in programming. Tagged in .