You can use LD_LIBRARY_PATH to tell the loader were to look first for shared libraries.
If the .so is in the current directory, you can invoke python as follows:
LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH python
質問
On a Linux machine I have a Python (PySide) program that needs libQtWebkit.so
as library. By default it uses the system-wide installed version found in /usr/lib
. However, this is not the correct version of this library.
The program has its own custom version of the libQtWebkit.so
file, which it needs to use. But I don't want to install this custom libary file system-wide into /usr/lib
.
So my question is: How can I tell the Python program to use a specific (local) .so
file instead of the globally installed one?
解決
You can use LD_LIBRARY_PATH to tell the loader were to look first for shared libraries.
If the .so is in the current directory, you can invoke python as follows:
LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH python