libclntsh.so.11.1:无法打开共享库文件. [英] libclntsh.so.11.1: cannot open shared object file.
问题描述
我想通过icrontab在Linux上计划任务,并且该任务是用python编写的,并且必须导入cx_Oracle
模块,所以我在 .bash_profile 中导出ORACLE_HOME
和LD_LIBRARY_PATH
. , 但
它会引发错误:
I want to schedule a task on Linux by icrontab, and the task is written in python and have to import cx_Oracle
module, so I export ORACLE_HOME
and LD_LIBRARY_PATH
in .bash_profile, but
it raise the error:
libclntsh.so.11.1:无法打开共享库文件.
libclntsh.so.11.1: cannot open shared object file.
因为可以通过在shell中发出命令来运行任务,如:
Since it is ok to run the task by issue the command in shell like:
python a.py # ok
我将icrontab中的任务更改为调用我的Python脚本的shell脚本,但是再次发生异常吗?
I change the task in icrontab into a shell script which invoke my Python script, but the exception recurred?
# the shell script scheduled in icrontab
#! bash
python a.py
您能帮忙怎么做吗?
推荐答案
可能您想指定PATH
-以及ORACLE_HOME
和LD_LIBRARY_PATH
-以便cron(1)
知道在哪里可以找到二进制文件.
在此处阅读"5 Crontab环境".
Possibly you want to specify PATH
— and also ORACLE_HOME
and LD_LIBRARY_PATH
— so that cron(1)
knows where to find binaries.
Read "5 Crontab environment" here.
这篇关于libclntsh.so.11.1:无法打开共享库文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!