On Aug 27, 2:54 pm, Olaf Meeuwissen <[EMAIL PROTECTED]> wrote:
> Graham Dumpleton <[EMAIL PROTECTED]> writes:
> > On Aug 27, 9:57 am, Olaf Meeuwissen <[EMAIL PROTECTED]> wrote:
> >> 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-i6
> >> 86.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.
>
> > How in your configuration are you getting:
>
> > /path/to/SandBox/lib/python2.5/site-packages
>
> > added to sys.path?
>
> The same way as /path/to/WSGIHome/lib/python2.5/site-packages, I'd
> presume. That is, I have no clue, really. I think virtualenv and/or
> easy_install automagically take care of that.
>
> > If this contains .pth files you can't just use:
>
> > sys.path.append(....)
>
> > as that doesn't result in .pth files being parsed with content added
> > to sys.path in the process.
>
> The /path/to/SandBox/lib/python2.5/site-packages directory contains a
> .pth file with the following contents:
>
> /usr/share/python-support/python-subversion
You previously indicated locations as:
*.py in /usr/share/python-support/python-subversion/{svn,libsvn}
*.so in /usr/lib/python-support/python-subversion/python2.[45]/
libsvn
And that you had:
$ 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
Shouldn't the directory containing the .so files, ie.,
/usr/lib/python-support/python-subversion/python2.5
still be in the .pth file? You now only have:
/usr/share/python-support/python-subversion
which would mean only .py files would be found.
Yes/No?
Graham
> so it seems to get added allright.
>
> > So, post exact details of the following.
>
> > 1. Version of mod_wsgi.
>
> $ dpkg-query -W libapache2-mod-wsgi
> libapache2-mod-wsgi 2.1-2
> $
>
> > 2. What WSGIPythonHome and WSGIPythonPath are set to in Apache
> > configuration.
>
> $ grep -r WSGIPythonHome /etc/apache2/sites-enabled/
> /etc/apache2/sites-enabled/WSGIHome:WSGIPythonHome /path/to/WSGIHome
> $ grep -r WSGIPythonPath /etc/apache2/sites-enabled/
> $
>
> > 3. Whether you are using WSGIDaemonProcess or WSGIProcessGroup and if
> > so what they are set to.
>
> $ grep -A3 WSGIDaemonProcess /etc/apache2/sites-enabled/SandBox
> WSGIDaemonProcess SandBox user=olaf group=olaf \
> threads=15 maximum-requests=10000 \
> python-path=/path/to/SandBox/lib/python2.5/site-packages
> $ grep WSGIProcessGroup /etc/apache2/sites-enabled/SandBox
> WSGIProcessGroup SandBox
> $
>
> > 4. What 'ls -las' output is on your sandbox site packages directory.
>
> $ ls -las /path/to/SandBox/lib/python2.5/site-packages/
> total 356
> 4 drwxr-xr-x 5 olaf olaf 4096 2008-08-27 08:25 .
> 4 drwxr-xr-x 4 olaf olaf 4096 2008-08-21 16:25 ..
> 4 drwxr-xr-x 4 olaf olaf 4096 2008-08-21 16:26
> Genshi-0.5.1-py2.5-linux-i686.egg
> 4 drwxr-xr-x 4 olaf olaf 4096 2008-08-21 16:26 Trac-0.11.1-py2.5.egg
> 4 -rw-r--r-- 1 olaf olaf 312 2008-08-21 16:26 easy-install.pth
> 4 drwxr-xr-x 5 olaf olaf 4096 2008-08-21 16:26
> pysqlite-2.4.1-py2.5-linux-i686.egg
> 4 -rw-r--r-- 1 olaf olaf 44 2008-08-27 08:45 python-subversion.pth
> 324 -rw-r--r-- 1 olaf olaf 324858 2008-05-21 06:20
> setuptools-0.6c8-py2.5.egg
> 4 -rw-r--r-- 1 olaf olaf 29 2008-08-21 16:25 setuptools.pth
> $
>
> > 5. The contents of the .pth files in that sandbox site packages
> > directory.
>
> $ cat /path/to/SandBox/lib/python2.5/site-packages/*.pth
> /usr/share/python-support/python-subversion
> import sys; sys.__plen = len(sys.path)
> ./setuptools-0.6c8-py2.5.egg
> ./pysqlite-2.4.1-py2.5-linux-i686.egg
> ./Trac-0.11.1-py2.5.egg
> ./Genshi-0.5.1-py2.5-linux-i686.egg
> import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:];
> p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert =
> p+len(new)
> ./setuptools-0.6c8-py2.5.egg
> $
>
> > 6. What your WSGI script file is doing in respect of manipulations of
> > sys.path or calls to site.addsitedir().
>
> I'm using the trac.wsgi script generated by trac-admin's deploy
> command modulo the sys.stderr logging you suggested. FWIW, I've
> attached the script.
>
> Hope this helps and thanks for helping me trouble shoot this.
>
>
>
> > Graham
>
> >> 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/ve
> >> rsioncontrol/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/ve
> >> rsioncontrol/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 athttp://member.fsf.org/
>
> trac.wsgi
> 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---