Python 屏幕中的脚本 window、cx_oracle 错误

Python script in screen window, cx_oracle error

我在 Cent OS 和 python3 上,试图 运行 通过 "screen".

连接到 Oracle 数据库的脚本

screen window,当我 运行 python3 [filename].py 命令时,出现以下错误。

Traceback (most recent call last):
  File "[filename].py", line 6, in <module>
    from login_credentials import *
  File "/home/[user]/[folder]/login_credentials.py", line 7, in <module>
    import cx_Oracle
ImportError: libclntsh.so.12.1: cannot open shared object file: No such file or directory

如果我 运行 从屏幕外的常规终端执行相同的命令,它工作正常。

我运行进入屏幕后立即执行以下命令:

导出 LD_LIBRARY_PATH=/u01/app/oracle/product/12.1.0.2/db_1/lib

确保指向 lib 子文件夹!