Boost logo

Boost :

From: Martin Wille (mw8329_at_[hidden])
Date: 2007-03-04 03:09:37


Stefan Seefeld wrote:
> Martin Wille wrote:
>
>> I ran your test manually and, according to strace, it tried to look for
>> modules in the wrong directory. I had the same problem two days ago and
>> I solved it by calling Py_SetProgramName() and passing the path to the
>> python binary to it.
>
> Looking into the Py_SetProgramName() docs indicated that name would be
> used to construct search paths. Given that this implies mapping things like
> <prefix>/bin/python to <prefix>/lib/python/site-packages, I don't think
> this does what I want.
> However, you appear to be right in that I have to prepend a search path
> to sys.path.

We might have another problem then. You're right, if your module isn't
in the standard search path then Py_SetProgramName can't help.

However, while Boost.Python gets built using a Python installation under
/usr/local here, the tests search for Python modules in /usr/lib. This
indicates that probably all tests search at the wrong place. This is
apparently not harmful if the Python versions match. However, I wouldn't
rely on that to work in the long run. Maybe, *all* tests need to call
Py_SetProgramName. Maybe, a helper for that should be built into
Boost.Python.

Regards,
m
Send instant messages to your online friends http://au.messenger.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk