Graham Dumpleton <[EMAIL PROTECTED]> writes:

> In the WSGI script file, add:
>
>   import sys
>
>   print >> sys.stderr, str(sys.path)
>
> This will cause value of sys.path to be logged to Apache error log. Go
> through what is dumped out to just make sure that .pth files contents
> added correctly and that all the other directories added look
> reasonable and refer to your virtual environment.

Thanks for the tip.  Did that and here is what ends up in my Apache
error log:

  [Wed Aug 27 08:45:58 2008] [error] 
['/path/to/WSGIHome/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg', 
'/path/to/WSGIHome/lib/python2.5/site-packages/Pygments-0.10-py2.5.egg', 
'/path/to/WSGIHome/lib/python2.5/site-packages/pytz-2008c-py2.5.egg', 
'/path/to/SandBox/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg', 
'/path/to/SandBox/lib/python2.5/site-packages/pysqlite-2.4.1-py2.5-linux-i686.egg',
 '/path/to/SandBox/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg', 
'/path/to/SandBox/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg',
 '/path/to/WSGIHome/lib/python2.5', 
'/path/to/WSGIHome/lib/python2.5/plat-linux2', 
'/path/to/WSGIHome/lib/python2.5/lib-tk', 
'/path/to/WSGIHome/lib/python2.5/lib-dynload', '/usr/lib/python2.5', 
'/usr/lib/python2.5/lib-tk', '/path/to/WSGIHome/lib/python2.5/site-packages', 
'/path/to/SandBox/lib/python2.5/site-packages', 
'/usr/share/python-support/python-subversion']

My WSGIPythonHome is set to /path/to/WSGIHome which is a symlink
pointing to a --no-site-packages virtualenv.  I use the symlink so I
can switch easily between virtualenvs w/ and w/o site packages.  The
/path/to/SandBox is another no-site-packages virtualenv and here's
where I added a python-subversion.pth with the contents shown by the
last element of the sys.path.

Still, I get an error message in the browser and the following in my
trac.log:

  2008-08-27 08:45:57,961 Trac[svn_fs] INFO: Failed to load Subversion bindings
  Traceback (most recent call last):
    File 
"/path/to/SandBox/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/versioncontrol/svn_fs.py",
 line 253, in __init__
      _import_svn()
    File 
"/path/to/SandBox/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/versioncontrol/svn_fs.py",
 line 69, in _import_svn
      from svn import fs, repos, core, delta
    File "/usr/share/python-support/python-subversion/svn/fs.py", line 19, in 
<module>
      from libsvn.fs import *
    File "/usr/share/python-support/python-subversion/libsvn/fs.py", line 7, in 
<module>
      import _fs
  ImportError: No module named _fs

I'm clueless.  Anyone have any ideas?

> Graham
>
> On Aug 26, 9:38 am, Olaf Meeuwissen <[EMAIL PROTECTED]> wrote:
>> Sorry, meant to get back to this earlier but work got in the way.
>>
>> osimons <[EMAIL PROTECTED]> writes:
>> > On Aug 21, 5:02 am, Olaf Meeuwissen <[EMAIL PROTECTED]> wrote:
>>
>> >> Is there an easy way to install the Subversion SWIG bindings in a
>> >> virtualenv, or two?
>>
>> > Install the Subversion bindings against your correct main Python as
>> > usual,
>>
>> That would be `apt-get install python-subversion` in my case.  Note
>> that this package installs the *.py files and the native .so libs in
>> different places.
>>
>>   *.py in /usr/share/python-support/python-subversion/{svn,libsvn}
>>   *.so in /usr/lib/python-support/python-subversion/python2.[45]/libsvn
>>
>> The libsvn_swig_py2.[45] .so's are in /usr/lib/.
>>
>> > and in each virtualenv sitepackages derived from this Python
>> > add a .pth file that points to location of svn libraries.
>>
>> > Like,
>>
>> > $ echo "/opt/local/lib/svn-python2.4" > /path/to/my/virutalenv/lib/
>> > python2.4/site-packages/svn-python.pth
>>
>> Did that.
>>
>>   $ cat /path/to/virtualenv/lib/python2.5/site-packages/svn-python.pth
>>   /usr/lib/python-support/python-subversion/python2.5
>>   /usr/lib/python-support/python-subversion
>>   /usr/share/python-support/python-subversion
>>
>> Restarted apache2 and fired up a new browser for good measure.
>>
>> > (My /opt/local/lib/svn-python2.4 contains the directories 'svn' and
>> > 'libsvn')
>>
>> Unfortunately, that didn't work.
>> Here's (what I think is) the relevant piece of the log:
>>
>>   2008-08-26 08:25:48,471 Trac[svn_fs] INFO: Failed to load Subversion 
>> bindings
>>   Traceback (most recent call last):
>>     File 
>> "/path/to/virtualenv/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac 
>> /versioncontrol/svn_fs.py", line 253, in __init__
>>       _import_svn()
>>     File 
>> "/path/to/virtualenv/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac 
>> /versioncontrol/svn_fs.py", line 69, in _import_svn
>>       from svn import fs, repos, core, delta
>>     File "/usr/share/python-support/python-subversion/svn/fs.py", line 19, 
>> in <module>
>>       from libsvn.fs import *
>>     File "/usr/share/python-support/python-subversion/libsvn/fs.py", line 7, 
>> in <module>
>>       import _fs
>>   ImportError: No module named _fs
>>
>> FWIW, I'm using virtualenv-1.1 and using a virtualenv with site
>> packages (that is, created without the --no-site-packages option) as
>> my WSGIPythonHome works fine.
>>
>> Any ideas?
-- 
Olaf Meeuwissen                   FLOSS Engineer -- AVASYS Corporation
FSF Associate Member #1962           sign up at http://member.fsf.org/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to