#2055 closed task (invalid)
Timeline and Browse Source... No module named svn (modules ARE installed)
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | version control/browser | Version: | 0.9b1 | 
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
I have gotten everything installed and configured. the trac-admin … initenv can see the svn modules (or else the install would not even work). I can view and use the wiki. When I try to use the Timeline or Browse Source I receive the following error message.
—- snip —-
Trac detected an internal error:
    No module named svn
Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/trac/web/cgi_frontend.py", line 115, in run
    dispatch_request(req.path_info, req, env)
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 107, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.4/site-packages/trac/Timeline.py", line 137, in process_request
    filters)
  File "/usr/local/lib/python2.4/site-packages/trac/versioncontrol/web_ui/changeset.py", line 106, in get_timeline_events
    repos = self.env.get_repository()
  File "/usr/local/lib/python2.4/site-packages/trac/env.py", line 143, in get_repository
    from trac.versioncontrol.svn_fs import SubversionRepository
  File "/usr/local/lib/python2.4/site-packages/trac/versioncontrol/svn_fs.py", line 26, in ?
    from svn import fs, repos, core, delta
ImportError: No module named svn
—- snip —-
System Specs (with custom builds of all the deps):
- RHEL 3
 - Python 2.4.1
 - Apache 2
 - Subversion 1.2.3
 
PYTHON_SITE=/usr/local/lib/python2.4/site-packages PYTHONPATH=/usr/local/lib/svn-python/libsvn:/usr/local/lib/svn-python/svn:/usr/local/lib/svn-python
(this is where svn installs it modules now, i could not get them to install into the sitedir)
Please let me know if there is anyother information I can provide that might be helpful.
Attachments (0)
Change History (8)
comment:1 by , 20 years ago
| Description: | modified (diff) | 
|---|---|
| Milestone: | 0.9 | 
| Resolution: | → invalid | 
| Status: | new → closed | 
comment:2 by , 20 years ago
Well, since the trac-admin command worked it appears that you have the PYTHONPATH variable set on the commandline, but not in your Apache config. You will need to use the Apache config option "SetEnv" to configure the PYTHONPATH variable for the Trac application.
comment:3 by , 20 years ago
As you noted, the Subversion Python bindings are not installed to default location. You need to make them available to Python scripts yourself. There are two ways to do this:
- Create a 
.pthfile in site-packages:$ echo /usr/local/lib/svn-python > /usr/local/lib/python2.4/site-packages
 - Use symlinks:
$ ln -s /usr/local/lib/svn-python/svn /usr/local/lib/python2.4/site-packages/svn $ ln -s /usr/local/lib/svn-python/libsvn /usr/local/lib/python2.4/site-packages/libsvn
 
comment:4 by , 20 years ago
That first snippet above should've been:
$ echo /usr/local/lib/svn-python > /usr/local/lib/python2.4/site-packages/svn.pth
comment:5 by , 20 years ago
I wound up symlinking to the dir with:
ln -s /usr/local/lib/svn-python/svn /usr/local/lib/python2.4/site-packages/svn ln -s /usr/local/lib/svn-python/libsvn /usr/local/lib/python2.4/site-packages/libsvn
which caused it to not be able to find libsvn_swig_py-1.so.0.
I then just re-ran ldconfig and then it worked.
So symlinking and running ldconfig worked for me.
Thanks for the tip and sorry for the noise.
comment:6 by , 20 years ago
| Type: | defect → task | 
|---|
Here's an echo command that will indeed create the .pth file mentioned above. $ echo "/usr/local/lib/svn-python" > /usr/local/lib/python2.4/site- packages/svn-python.pth
comment:7 by , 19 years ago
estou com problemas esta dando o erro no trac de
Failed to create environment. You need to install mxDateTime
aquardo retorno



  
This is an installation support issue, not a Trac bug, so please ask on the IrcChannel or MailingList if you need help resolving this.