osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to force the path of a lib ?


(Resend because the previous message was incomplete)


Hi,

I am working on a python3 binding of a C++ lib. This lib is installed in 
my system but the latest version of this lib introduce several 
incompatibilities. So I need to update my python binding.

I'm working into a virtual environment (py370_venv) python-3.7.0 is 
installed into ./localpythons/lib/python3.7

So, the paths are:
# python-3.7.0
~/./localpythons/lib/python3.7/
# my binding python -> libexiv2
~/./localpythons/lib/python3.7/site-packages/pyexiv2/*.py
~/./localpythons/lib/python3.7/site-packages/pyexiv2/libexiv2python.cpython-37m-x86_64-linux-gnu.so

# and the latest version of libexiv2
~/CPython/py370_venv/lib/libexiv2.so.0.27.0

All theses path are in the sys.path

Now I test my binding:
 >>> import pyexiv2
Traceback (most recent call last):
 ? File "<stdin>", line 1, in <module>
 ? File 
"/home/vincent/CPython/py370_venv/lib/python3.7/site-packages/py3exiv2-0.1.0-py3.7-linux-x86_64.egg/pyexiv2/__init__.py", 
line 60, in <module>
 ??? import libexiv2python
ImportError: 
/home/vincent/CPython/py370_venv/lib/python3.7/site-packages/py3exiv2-0.1.0-py3.7-linux-x86_64.egg/libexiv2python.cpython-37m-x86_64-linux-gnu.so: 
undefined symbol: _ZN5Exiv27DataBufC1ERKNS_10DataBufRefE
 >>>

Checking the libexiv2.so the symbol exists
~/CPython/py370_venv/lib$ objdump -T libexiv2.so.0.27.0
....
000000000012c8d0 g??? DF .text??? 000000000000000f? Base 
_ZN5Exiv27DataBufC1ERKNS_10DataBufRefE
....

But it is not present into my old libexiv2 system, so I presume python use
/usr/lib/x86_64-linux-gnu/libexiv2.so.14.0.0? (The old 0.25) instead of
 ?~/CPython/py370_venv/lib/libexiv2.so.0.27.0 (The latest 0.27)

How can I solve that ?

My sys.path:
['', '/home/vincent/.localpythons/lib/python37.zip', 
'/home/vincent/.localpythons/lib/python3.7', 
'/home/vincent/.localpythons/lib/python3.7/lib-dynload', 
'/home/vincent/CPython/py370_venv/lib/python3.7/site-packages', 
'/home/vincent/CPython/py370_venv/lib/python3.7/site-packages/py3exiv2-0.1.0-py3.7-linux-x86_64.egg', 
'/home/vincent/CPython/py370_venv/lib/']

Thanks, Vincent