oracle_libs = os.environ['ORACLE_HOME'] + '/lib/'
rerun = True
if not 'LD_LIBRARY_PATH' in os.environ:
    os.environ['LD_LIBRARY_PATH'] = ':' + oracle_libs
elif not oracle_libs in os.environ.get('LD_LIBRARY_PATH'):
    os.environ['LD_LIBRARY_PATH'] += ':' + oracle_libs
else:
    rerun = False
if rerun:
    os.execve(os.path.realpath(__file__), sys.argv, os.environ)
Изменить LD_LIBRARY_PATH текущей среды процесса