473,412 Members | 5,385 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

shared library search path


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
1 2612
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Francisco Miguel Montenegro Montes | last post by:
Hi, perhaps some of you can help me... I'm installing Python 2.3 (in Linux RedHat 8.0) and I need to build it like a shared library, because I want to interact Python with PostgreSQL. Following...
6
by: klh | last post by:
I have an old version of DB2 Connect (v 6) installed on a Sun Solaris (v 2.9)box. It has been installed for several years, and to me, it seems to work okay. However, an application that uses DB2...
0
by: Peter | last post by:
When I issue call sqlj.install_jar('file:///f:/jars/mail.jar','MAIL'); I get the messages SQL4301N Java or .NET interpreter startup or communication failed, reason
2
by: tshad | last post by:
I have a program I am trying to compile into a dll and am getting a bunch of: the following errors: error BC30469: Reference to a non-shared member requires an object reference. At first, I...
11
by: tshad | last post by:
I am setting up some of my functions in a class called MyFunctions. I am not clear as to the best time to set a function as Shared and when not to. For example, I have the following bit...
3
by: Eric E | last post by:
Hi, I have an installation of Postgres 7.4.2 on SuSE 9.1. This version of SuSE comes with a binary for plperl and several other postgres procedural languages. All the others, including plpgsql...
5
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: David T. Ashley | last post by:
I've occasionally had trouble compiling and linking programs that use shared libraries. That never made a lot of sense to me, because I thought the operating system went hunting for the symbols...
5
by: Visa Inquirer | last post by:
I need my program to always link to a particular shared library, not the one in LD_LIBRARY_PATH. Is there a way to specify shared library by full path when linking so that when running...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.