Python SVN绑定 – ImportError:没有名为svn的模块
我最近使用apt-get upgrade更新了我的服务器,然后突然trac开始显示以下错误消息:Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
我曾尝试安装python-subversion,但已经安装了,所以我重新安装了它,但这没有帮助.
~# 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
我在ubuntu 11.10 x64上运行svn 1.7.4.
我对python知之甚少.为什么python不再能找到SVN?
更新
我也尝试使用sudo apt-get install python-svn安装包python-svn.这也没有帮助.
我在Ubuntu 12.04上遇到了类似的问题.我使用WANdisco软件包将subversion升级到1.7.5.这个包将svn绑定到python2.6,而Ubuntu 12.04绑定python2.7.这是一个解决了我身边问题的脚本:
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
最好的祝福Wojciech Dec