issue with LD_LIBRARY_PATH

238 views
Skip to first unread message

David Durham, Jr.

unread,
Apr 17, 2008, 1:53:43 PM4/17/08
to mod...@googlegroups.com
Hi all,

I've had an issue with cxOracle. In a python shell, 'import
cx_Oracle' failed with:

ImportError: libclntsh.so.10.1: cannot open shared object file: No
such file or directory

I was able to correct this for python shells with export
LD_LIBRARY_PATH, but a modwsgi app still fails with the same error.
Does anyone know how I'd correct this?

Thanks,
Dave

Reed O'Brien

unread,
Apr 17, 2008, 2:14:45 PM4/17/08
to mod...@googlegroups.com
compile modwsgi with the LD_LIBRARY_PATH set.

~ro

Reed O'Brien

unread,
Apr 17, 2008, 2:13:32 PM4/17/08
to mod...@googlegroups.com
compile modwsgi with the LD_LIBRARY_PATH set.

~ro


On Apr 17, 2008, at 1:53 PM, David Durham, Jr. wrote:
>

David Durham, Jr.

unread,
Apr 17, 2008, 4:11:06 PM4/17/08
to mod...@googlegroups.com
On Thu, Apr 17, 2008 at 1:14 PM, Reed O'Brien <reedo...@gmail.com> wrote:
>
> compile modwsgi with the LD_LIBRARY_PATH set.

It was/is set. Right now, I have a solution where I start apache with

LD_LIBRARY_PATH=... apachectl start

Graham Dumpleton

unread,
Apr 17, 2008, 4:57:39 PM4/17/08
to mod...@googlegroups.com
2008/4/18 David Durham, Jr. <david.d...@gmail.com>:

Compiling with LD_LIBRARY_PATH set will make no difference. What you
can do though is when compiling/installing the Oracle Python wrappers,
set LD_RUN_PATH to the library directory containing the Oracle
libraries. For example:

LD_RUN_PATH=/some/path/oracle/lib python setup.py build
LD_RUN_PATH=/some/path/oracle/lib python sudo setup.py install

This is mentioned in section 'Unable To Find Python Shared Library' of:

http://code.google.com/p/modwsgi/wiki/InstallationIssues

Although it talks about this issue for mod_wsgi, same can be applied
to your extension module.

The alternative is if your Apache installation has an 'envvars' file
in same directory as Apache httpd excutable, add to that:

LD_LIBRARY_PATH=/some/path/oracle/lib
export LD_LIBRARY_PATH

If no 'envvars' file with your Apache installation, would need to be
set in Apache startup scripts where it invokes apachectl.

Graham

David Durham, Jr.

unread,
Apr 17, 2008, 5:08:48 PM4/17/08
to mod...@googlegroups.com
> Compiling with LD_LIBRARY_PATH set will make no difference. What you
> can do though is when compiling/installing the Oracle Python wrappers,
> set LD_RUN_PATH to the library directory containing the Oracle
> libraries. For example:
>
> LD_RUN_PATH=/some/path/oracle/lib python setup.py build
> LD_RUN_PATH=/some/path/oracle/lib python sudo setup.py install

Thanks, I'll probably go with this option. I'll post if something
goes wrong, but it sounds like this is exactly what I need.

-Dave

Reed O'Brien

unread,
Apr 17, 2008, 5:17:37 PM4/17/08
to mod...@googlegroups.com
On Apr 17, 2008, at 4:57 PM, Graham Dumpleton wrote:
>
> 2008/4/18 David Durham, Jr. <david.d...@gmail.com>:
>>
>> On Thu, Apr 17, 2008 at 1:14 PM, Reed O'Brien
>> <reedo...@gmail.com> wrote:
>>>
>>> compile modwsgi with the LD_LIBRARY_PATH set.
>>
>> It was/is set. Right now, I have a solution where I start apache
>> with
>>
>> LD_LIBRARY_PATH=... apachectl start
>
> Compiling with LD_LIBRARY_PATH set will make no difference. What you
> can do though is when compiling/installing the Oracle Python wrappers,
> set LD_RUN_PATH to the library directory containing the Oracle
> libraries. For example:
>
> LD_RUN_PATH=/some/path/oracle/lib python setup.py build
> LD_RUN_PATH=/some/path/oracle/lib python sudo setup.py install

you can also define the runtime library path with:

CFLAGS="-Wl,--rpath=/path/to/lib"

Or something similar. On some system the man page said a single
hyphen but it silently failed unless you used to hyphens. I don't
recall if that was RHEL or BSD.

But if LD_RUN_PATH works then go for it.

Sorry I misspoke earlier

Reply all
Reply to author
Forward
0 new messages