By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,772 Members | 937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,772 IT Pros & Developers. It's quick & easy.

shared library search path

P: n/a

Hi. I've wrapped a C++ class with Boost.Python and that works great. But, I
am now packaging my application so that it can be distributed. The structure
is basically this:

.../bin/foo.py
.../lib/foo.so
.../lib/bar.py

In foo.py I do the following:

sys.path.append(os.path.dirname(sys.path[0]) + '/lib')

and this allows foo.py to import bar. Great.

But, the foo.so cannot be imported. The import only succeeds if I place
foo.so next to foo.py in the bin directory.

I searched through the 2.4.2 documentation on python.org but I can't find
a proper explanation on how the shared library loader works.

Does anyone understand what it going on here?

S.

Nov 3 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Stefan Arentz wrote:

Hi. I've wrapped a C++ class with Boost.Python and that works great. But,
I am now packaging my application so that it can be distributed. The
structure is basically this:

.../bin/foo.py
.../lib/foo.so
.../lib/bar.py

In foo.py I do the following:

sys.path.append(os.path.dirname(sys.path[0]) + '/lib')

and this allows foo.py to import bar. Great.

But, the foo.so cannot be imported. The import only succeeds if I place
foo.so next to foo.py in the bin directory.

I searched through the 2.4.2 documentation on python.org but I can't find
a proper explanation on how the shared library loader works.

Does anyone understand what it going on here?

S.


No, but here is the code I use:
import sys
sys.path.append ('../wrap')
Nov 3 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.