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.

7
  • 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, 2012 at 14:25
  • @AndrewM. its aptitude's/dpkg python from the ubuntu repositories in /usr/bin/python. May 12, 2012 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, 2012 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 May 12, 2012 at 16:17
  • @AndrewM. where does python expect those svn binding to be? May 12, 2012 at 19:48

4 Answers 4

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

3
  • Hey thanks a lot for sharing this. It looks very promising. Will check it out asap. Jun 19, 2012 at 17:35
  • Awesome! I've spent several hours trying different solutions but only this one has worked.
    – luchaninov
    Mar 11, 2013 at 18:49
  • The newer WANdisco packages for Subversion 1.8 (released just last week) seem to fix this as well. They work fine on 12.04. Jun 25, 2013 at 11:54
0

You just need to install them with apt-get

apt-get update
apt-get install python-svn
1
  • Sorry that didn't work. See my update to the question. May 12, 2012 at 12:13
0

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

1
  • 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? May 16, 2012 at 23:09
-1

For me the following helped:

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

and then all worked fine.

3
  • 2
    OP already said reinstalling python-subversion didn't help, so you're posting this as answer to... rub it in? Sep 24, 2012 at 20:43
  • i had the same problem .. and you have to install python-svn first and then python-subversion. Did you tried this?
    – Kordi
    Sep 29, 2012 at 13:20
  • @Kordi I have tried it… and it didn't help! Mar 16, 2016 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .