python - Unsupported version control system "svn": No module named svn

1,079 views
Skip to first unread message

alexus

unread,
Feb 9, 2015, 12:17:39 PM2/9/15
to trac-...@googlegroups.com
Hello,

I'm using The Trac Project with TracModWSGI – The Trac Project on RHEL7:

    # cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 7.0 (Maipo)
    # rpm -q httpd mod_wsgi subversion swig
    httpd-2.4.6-18.el7_0.x86_64
    mod_wsgi-3.4-12.el7_0.x86_64
    subversion-1.7.14-6.el7.x86_64
    swig-2.0.10-4.el7.x86_64
    # grep tracopt.versioncontrol conf/trac.ini
    tracopt.versioncontrol.git.* = enabled
    tracopt.versioncontrol.svn.* = enabled
    #

While trying to "Browse Source" (Subversion), I'm getting following error:

"Trac Error:" - "Unsupported version control system "svn": No module named svn"

"Logging":

    Trac[svn_fs] INFO: Failed to load Subversion bindings
    Traceback (most recent call last):
      File "build/bdist.linux-x86_64/egg/tracopt/versioncontrol/svn/svn_fs.py", line 296, in __init__
        _import_svn()
      File "build/bdist.linux-x86_64/egg/tracopt/versioncontrol/svn/svn_fs.py", line 78, in _import_svn
        from svn import fs, repos, core, delta
    ImportError: No module named svn

Issue is with Python bindings for Subversion can't be loaded by Trac:

    # python
    Python 2.7.5 (default, Feb 11 2014, 07:46:25)
    [GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from svn import core
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named svn
    >>>
    #

Quote from TracSubversion – The Trac Project:

> One simple solution for rpm-based operating systems, is to install the
> subversion-python bindings rpm.

Unfortunately "No package subversion-python available.":

    # subscription-manager repos | grep '^Repo ID' | egrep -v 'beta|debug|fastrack|source'
    Repo ID:   rhel-7-server-v2vwin-1-rpms
    Repo ID:   rhel-7-server-rpms
    Repo ID:   rhel-7-server-extras-rpms
    Repo ID:   rhel-7-server-rhn-tools-rpms
    Repo ID:   rhel-7-server-thirdparty-oracle-java-rpms
    Repo ID:   rhel-7-server-rh-common-rpms
    Repo ID:   rhel-7-server-supplementary-rpms
    Repo ID:   rhel-7-server-optional-rpms
    # yum install subversion-python
    Loaded plugins: product-id, subscription-manager
    No package subversion-python available.
    Error: Nothing to do
    # yum repolist
    Loaded plugins: product-id, subscription-manager
    repo id                                   repo name                                               status
    !epel/x86_64                              Extra Packages for Enterprise Linux 7 - x86_64          7,192
    rhel-7-server-rpms/7Server/x86_64         Red Hat Enterprise Linux 7 Server (RPMs)                5,320
    repolist: 12,512
    #

I'm researching "pysvn" (as alternative) instead of "subversion-python" meanwhile.

Please advise.

Ryan Ollos

unread,
Feb 9, 2015, 1:40:38 PM2/9/15
to trac-...@googlegroups.com
pysvn won't work. I'm not very familiar with RHEL, but it looks like our documentation says that the bindings will be installed when the  svn package is installed

Here are some debugging steps to follow:

On Ubuntu running Trac in a virtualenv, I've had to manually create links in the site-packages, similar to what is described here: 

alexus

unread,
Feb 9, 2015, 3:52:58 PM2/9/15
to trac-...@googlegroups.com, ryan.j...@gmail.com
Ryan,

First, I'd like to "Thank you for your reply".

As I mention in my topic subversion is already installed on my system:

# rpm -q subversion
subversion-1.7.14-6.el7.x86_64

I also went over TracSubversion – The Trac Project and tried implementing some of it on my system as well:

# pwd
/usr/lib64/python2.7/site-packages
# cat svn.pth 
/usr/lib64/
# ll /usr/lib64/libsvn_*.0.0
-rwxr-xr-x. 1 root root 380256 Mar  5  2014 /usr/lib64/libsvn_client-1.so.0.0.0
-rwxr-xr-x. 1 root root  57488 Mar  5  2014 /usr/lib64/libsvn_delta-1.so.0.0.0
-rwxr-xr-x. 1 root root  70048 Mar  5  2014 /usr/lib64/libsvn_diff-1.so.0.0.0
-rwxr-xr-x. 1 root root  32704 Mar  5  2014 /usr/lib64/libsvn_fs-1.so.0.0.0
-rwxr-xr-x. 1 root root 201032 Mar  5  2014 /usr/lib64/libsvn_fs_base-1.so.0.0.0
-rwxr-xr-x. 1 root root 184680 Mar  5  2014 /usr/lib64/libsvn_fs_fs-1.so.0.0.0
-rwxr-xr-x. 1 root root  11152 Mar  5  2014 /usr/lib64/libsvn_fs_util-1.so.0.0.0
-rwxr-xr-x. 1 root root  49520 Mar  5  2014 /usr/lib64/libsvn_ra-1.so.0.0.0
-rwxr-xr-x. 1 root root  37320 Mar  5  2014 /usr/lib64/libsvn_ra_local-1.so.0.0.0
-rwxr-xr-x. 1 root root 162376 Mar  5  2014 /usr/lib64/libsvn_ra_neon-1.so.0.0.0
-rwxr-xr-x. 1 root root 104496 Mar  5  2014 /usr/lib64/libsvn_ra_svn-1.so.0.0.0
-rwxr-xr-x. 1 root root 191592 Mar  5  2014 /usr/lib64/libsvn_repos-1.so.0.0.0
-rwxr-xr-x. 1 root root 419168 Mar  5  2014 /usr/lib64/libsvn_subr-1.so.0.0.0
-rwxr-xr-x. 1 root root  83544 Mar  5  2014 /usr/lib64/libsvn_swig_py-1.so.0.0.0
-rwxr-xr-x. 1 root root 615296 Mar  5  2014 /usr/lib64/libsvn_wc-1.so.0.0.0

as /usr/lib64 is where my "libsvn" resides.

same documentation also mentions following:
"One simple solution for rpm-based operating systems, is to install the subversion-python bindings rpm."
and again as I stated in my topic earlier "subversion-python" is not available for RHEL7.

if I overlooked something or you have any other ideas, please let me know.

Thanks again!

Ryan Ollos

unread,
Feb 9, 2015, 4:43:51 PM2/9/15
to alexus, trac-...@googlegroups.com
On Mon, Feb 9, 2015 at 1:30 PM, alexus <ale...@gmail.com> wrote:
Ryan,

If I remember correctly Trac was installed via "easy_install", I'm not
seeing Trac inside of /usr/lib64/python2.7/site-package.

I already tried what you're proposing:

# cd /usr/lib64/python2.7/site-packages/
# cat svn.pth
/usr/lib64/

I think you should do a full search of your system for "svn" and "libsvn" directories and consider whether we are really pointing at the right directories.
 
# ll svn
lrwxrwxrwx. 1 root root 12 Feb  9 15:54 svn -> /usr/bin/svn

On Ubuntu, I didn't have the symlink for svn pointing to the svn executable, rather it pointed to an "svn" directory containing libraries.
 
# ll libsvn_*
lrwxrwxrwx. 1 root root 31 Feb  9 15:54 libsvn_client-1.so.0 ->
/usr/lib64/libsvn_client-1.so.0
lrwxrwxrwx. 1 root root 35 Feb  9 15:54 libsvn_client-1.so.0.0.0 ->
/usr/lib64/libsvn_client-1.so.0.0.0
lrwxrwxrwx. 1 root root 30 Feb  9 15:54 libsvn_delta-1.so.0 ->
/usr/lib64/libsvn_delta-1.so.0
lrwxrwxrwx. 1 root root 34 Feb  9 15:54 libsvn_delta-1.so.0.0.0 ->
/usr/lib64/libsvn_delta-1.so.0.0.0
lrwxrwxrwx. 1 root root 29 Feb  9 15:54 libsvn_diff-1.so.0 ->
/usr/lib64/libsvn_diff-1.so.0
lrwxrwxrwx. 1 root root 33 Feb  9 15:54 libsvn_diff-1.so.0.0.0 ->
/usr/lib64/libsvn_diff-1.so.0.0.0
lrwxrwxrwx. 1 root root 27 Feb  9 15:54 libsvn_fs-1.so.0 ->
/usr/lib64/libsvn_fs-1.so.0
lrwxrwxrwx. 1 root root 31 Feb  9 15:54 libsvn_fs-1.so.0.0.0 ->
/usr/lib64/libsvn_fs-1.so.0.0.0
lrwxrwxrwx. 1 root root 32 Feb  9 15:54 libsvn_fs_base-1.so.0 ->
/usr/lib64/libsvn_fs_base-1.so.0
lrwxrwxrwx. 1 root root 36 Feb  9 15:54 libsvn_fs_base-1.so.0.0.0 ->
/usr/lib64/libsvn_fs_base-1.so.0.0.0
lrwxrwxrwx. 1 root root 30 Feb  9 15:54 libsvn_fs_fs-1.so.0 ->
/usr/lib64/libsvn_fs_fs-1.so.0
lrwxrwxrwx. 1 root root 34 Feb  9 15:54 libsvn_fs_fs-1.so.0.0.0 ->
/usr/lib64/libsvn_fs_fs-1.so.0.0.0
lrwxrwxrwx. 1 root root 32 Feb  9 15:54 libsvn_fs_util-1.so.0 ->
/usr/lib64/libsvn_fs_util-1.so.0
lrwxrwxrwx. 1 root root 36 Feb  9 15:54 libsvn_fs_util-1.so.0.0.0 ->
/usr/lib64/libsvn_fs_util-1.so.0.0.0
lrwxrwxrwx. 1 root root 27 Feb  9 15:54 libsvn_ra-1.so.0 ->
/usr/lib64/libsvn_ra-1.so.0
lrwxrwxrwx. 1 root root 31 Feb  9 15:54 libsvn_ra-1.so.0.0.0 ->
/usr/lib64/libsvn_ra-1.so.0.0.0
lrwxrwxrwx. 1 root root 33 Feb  9 15:54 libsvn_ra_local-1.so.0 ->
/usr/lib64/libsvn_ra_local-1.so.0
lrwxrwxrwx. 1 root root 37 Feb  9 15:54 libsvn_ra_local-1.so.0.0.0 ->
/usr/lib64/libsvn_ra_local-1.so.0.0.0
lrwxrwxrwx. 1 root root 32 Feb  9 15:54 libsvn_ra_neon-1.so.0 ->
/usr/lib64/libsvn_ra_neon-1.so.0
lrwxrwxrwx. 1 root root 36 Feb  9 15:54 libsvn_ra_neon-1.so.0.0.0 ->
/usr/lib64/libsvn_ra_neon-1.so.0.0.0
lrwxrwxrwx. 1 root root 31 Feb  9 15:54 libsvn_ra_svn-1.so.0 ->
/usr/lib64/libsvn_ra_svn-1.so.0
lrwxrwxrwx. 1 root root 35 Feb  9 15:54 libsvn_ra_svn-1.so.0.0.0 ->
/usr/lib64/libsvn_ra_svn-1.so.0.0.0
lrwxrwxrwx. 1 root root 30 Feb  9 15:54 libsvn_repos-1.so.0 ->
/usr/lib64/libsvn_repos-1.so.0
lrwxrwxrwx. 1 root root 34 Feb  9 15:54 libsvn_repos-1.so.0.0.0 ->
/usr/lib64/libsvn_repos-1.so.0.0.0
lrwxrwxrwx. 1 root root 29 Feb  9 15:54 libsvn_subr-1.so.0 ->
/usr/lib64/libsvn_subr-1.so.0
lrwxrwxrwx. 1 root root 33 Feb  9 15:54 libsvn_subr-1.so.0.0.0 ->
/usr/lib64/libsvn_subr-1.so.0.0.0
lrwxrwxrwx. 1 root root 32 Feb  9 15:54 libsvn_swig_py-1.so.0 ->
/usr/lib64/libsvn_swig_py-1.so.0
lrwxrwxrwx. 1 root root 36 Feb  9 15:54 libsvn_swig_py-1.so.0.0.0 ->
/usr/lib64/libsvn_swig_py-1.so.0.0.0
lrwxrwxrwx. 1 root root 27 Feb  9 15:54 libsvn_wc-1.so.0 ->
/usr/lib64/libsvn_wc-1.so.0
lrwxrwxrwx. 1 root root 31 Feb  9 15:54 libsvn_wc-1.so.0.0.0 ->
/usr/lib64/libsvn_wc-1.so.0.0.0
#

without any luck(


On Mon, Feb 9, 2015 at 4:04 PM, Ryan Ollos <rjo...@gmail.com> wrote:
> Are you running Trac from a virtualenv, or rather is it installed in
> /usr/lib64/python2.7/site-packages?
>
> On Ubuntu 14.04 I've had to do the following (actually these steps might be
> out-of-date for 14.04, in which case they work in 12.04):
>
> Add the following line in svn.pth:
> /usr/lib/pyshared/python2.7/libsvn
>
> Add the following symbolic links lib/python2.7/site-packages:
> svn -> /usr/share/pyshared/svn
> libsvn -> /usr/share/pyshared/libsvn
>
> The exact steps will undoubtedly differ on RedHat, but maybe that gives you
> some things to look for.



--
http://alexus.org/

Greg Earle

unread,
Feb 9, 2015, 4:44:35 PM2/9/15
to trac-...@googlegroups.com
On Feb 9, 2015, at 12:52 PM, alexus wrote:

> "One simple solution for rpm-based operating systems, is to install the
> subversion-python bindings rpm."
>
> and again as I stated in my topic earlier "subversion-python" is not
> available for RHEL7.

You appear to be using RHEL 7.0 Server, and one of your repos is

rhel-7-server-optional-rpms

I just noticed that

subversion-python-1.7.14-6.el7.x86_64.rpm

is readily available from the "rhel-7-workstation-optional-rpms" repo.

I don't know why it would be available in the Workstation Optional repo
but not in the Server Optional repo.

- Greg

alexus

unread,
Feb 10, 2015, 11:01:59 AM2/10/15
to trac-...@googlegroups.com, ea...@isolar.dyndns.org
Greg,

You're right, after I download & install rpm, binding works as expected now)

Thank you!

Ryan Ollos

unread,
Feb 10, 2015, 12:45:32 PM2/10/15
to trac-...@googlegroups.com
On Tue, Feb 10, 2015 at 8:01 AM, alexus <ale...@gmail.com> wrote:
Greg,

You're right, after I download & install rpm, binding works as expected now)

Thank you!

It would be great if the documentation could be updated with your findings:

Do you know whether symbolics links are needed, or is it sufficient to just install the python-subversion package the workstation repository?
 

alexus

unread,
Feb 10, 2015, 4:13:06 PM2/10/15
to trac-...@googlegroups.com, ryan.j...@gmail.com
actually that's it, as soon as I installed that missing rpm, it pretty much works out of the box, no need for any symbolic links.

Ryan Ollos

unread,
Feb 10, 2015, 5:21:12 PM2/10/15
to alexus, trac-...@googlegroups.com
On Tue, Feb 10, 2015 at 1:13 PM, alexus <ale...@gmail.com> wrote:
actually that's it, as soon as I installed that missing rpm, it pretty much works out of the box, no need for any symbolic links.


Thanks, documented in:

Please refine the statement if you see room for improvement. 

alexus

unread,
Feb 10, 2015, 5:53:11 PM2/10/15
to trac-...@googlegroups.com, ale...@gmail.com, ryan.j...@gmail.com

Ryan Ollos

unread,
Feb 10, 2015, 6:06:57 PM2/10/15
to alexus, trac-...@googlegroups.com
On Tue, Feb 10, 2015 at 2:53 PM, alexus <ale...@gmail.com> wrote:

alexus

unread,
Feb 11, 2015, 3:10:51 PM2/11/15
to trac-...@googlegroups.com, ale...@gmail.com, ryan.j...@gmail.com
you're welcome, but it seems like jomae made another set of change and changes makes wiki incorrect again..

Ryan Ollos

unread,
Feb 11, 2015, 3:16:56 PM2/11/15
to alexus, trac-...@googlegroups.com
On Wed, Feb 11, 2015 at 12:10 PM, alexus <ale...@gmail.com> wrote:
you're welcome, but it seems like jomae made another set of change and changes makes wiki incorrect again..

I don't have experience with RHEL to judge, but he may reply if you describe here which of edits you think are incorrect. Other RHEL users might have input as well.

alexus

unread,
Feb 11, 2015, 3:56:32 PM2/11/15
to Ryan Ollos, trac-...@googlegroups.com
Ryan,

I went through this in RHEL5, RHEL6 and now RHEL7.

I corrected it again in revision 128.
--
http://alexus.org/

Jun Omae

unread,
Feb 11, 2015, 7:50:29 PM2/11/15
to trac-...@googlegroups.com
No, no, no.
subversion-python package is available since CentOS 7.
Subversion python bindings is included in subversion package in CentOS 5 and 6.



CentOS 6:

[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
[root@localhost ~]# yum list subversion
...
Installed Packages
subversion.x86_64 1.6.11-12.el6_6 @updates
[root@localhost ~]# yum list subversion-python
...
Error: No matching Packages to list
[root@localhost ~]# rpm -qf /usr/lib64/python2.6/site-packages/svn
subversion-1.6.11-12.el6_6.x86_64


CentOS 5:

[root@localhost ~]# cat /etc/redhat-release
CentOS release 5.11 (Final)
[root@localhost ~]# yum list subversion
...
Installed Packages
subversion.x86_64 1.6.11-12.el5_10 installed
[root@localhost ~]# yum list subversion-python
...
Error: No matching Packages to list
[root@localhost ~]# rpm -qf /usr/lib64/python2.4/site-packages/svn
subversion-1.6.11-12.el5_10
> --
> You received this message because you are subscribed to the Google Groups "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
> To post to this group, send email to trac-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/trac-users.
> For more options, visit https://groups.google.com/d/optout.



--
Jun Omae <jun...@gmail.com> (大前 潤)

alexus

unread,
Feb 12, 2015, 12:29:42 PM2/12/15
to trac-...@googlegroups.com
Actually You're 100% correct and I'm the one who's wrong. I'm mixed it with FreeBSD as on FreeBSD that's separate and on RHEL6 that comes with subversion, so I apologize for wrong information.
Reply all
Reply to author
Forward
0 new messages