4

I have recently updated my server using apt-get upgrade and then suddenly trac started showing the following error message:

Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

I have tried to install python-subversion, but that was installed already, so I have reinstalled it, but that didn't help.

~# python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import svn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named svn

I am running svn 1.7.4 on ubuntu 11.10 x64.

I do not know much about python. Why doesn't python find SVN anymore?

Update

I have also tried installing the package python-svn using sudo apt-get install python-svn. That did not help either.

d_inevitable
  • 209
  • 1
  • 6
  • 19
  • Are you using the aptitude managed version of Python? Or is your `python` in a different place? Try doing a `which python`. – Andrew M. May 12 '12 at 14:25
  • @AndrewM. its aptitude's/dpkg python from the ubuntu repositories in `/usr/bin/python`. – d_inevitable May 12 '12 at 14:59
  • You can likely solve this by doing `pip install svn`, although it might be worth looking into why `svn` was not put into the correct place. – Andrew M. May 12 '12 at 15:02
  • @AndrewM. `sudo pip install svn` `Downloading/unpacking svn` `Could not find any downloads that satisfy the requirement svn` `No distributions at all found for svn` – d_inevitable May 12 '12 at 16:17
  • @AndrewM. where does python expect those svn binding to be? – d_inevitable May 12 '12 at 19:48
  • It should be in the site-packages directory of your Python installation. It looks like `svn` isn't distributed via `pip`, so my suggestion was for not. :( Have you tried removing (and purging) the python-svn package? – Andrew M. May 12 '12 at 23:47
  • @AndrewM. the only such directory I could find was: `/usr/local/lib/python2.7/site-packages` and that one is totally empty. `python-svn` wasn't installed when Mike first suggested it. But I have just tried to purge it and re-install it, in order to be sure, but it still didn't fix it. – d_inevitable May 13 '12 at 01:22

4 Answers4

5

I've had similar problem on Ubuntu 12.04. I upgraded subversion to 1.7.5 using WANdisco package. This package binds svn to python2.6 and Ubuntu 12.04 has python2.7.

Here is a script which solved the problem on my side:

mkdir /usr/lib/python2.7/dist-packages/libsvn
for f in /usr/lib/pyshared/python2.6/libsvn/*; do ln -s $f /usr/lib/python2.7/dist-packages/libsvn/; done
for f in /usr/share/pyshared/libsvn/*; do ln -s $f /usr/lib/python2.7/dist-packages/libsvn/; done

mkdir /usr/lib/python2.7/dist-packages/svn
for f in /usr/share/pyshared/svn/*; do ln -s $f /usr/lib/python2.7/dist-packages/svn/; done

mkdir /usr/lib/pyshared/python2.7/libsvn
for f in /usr/lib/pyshared/python2.6/libsvn/*; do ln -s $f /usr/lib/pyshared/python2.7/libsvn/; done

Best regards Wojciech Dec

0

You just need to install them with apt-get

apt-get update
apt-get install python-svn
Mike
  • 21,910
  • 7
  • 55
  • 79
0

The python module that python-svn installs is called pysvn. Apparently Trac needs a SWIG binding instead. See

  • Yeah I have installed the ubuntu package `python-subversion` with `apt-get install python-subversion` as mentioned in the question. And trac used to work. It's just that it suddenly stopped working because the package disappeared. Why did it disappear, and how can I get it back? – d_inevitable May 16 '12 at 23:09
-1

For me the following helped:

apt-get install python-svn
apt-get install python-subversion

and then all worked fine.

Kordi
  • 131
  • 5