MOD_WSGI找不到Oracle instantclient库

2024-06-02 04:54:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个flask应用程序在Apache server上使用mod_wsgi运行。在我尝试使用cx_Oracle访问数据库之前,一切正常。此时我得到以下错误:

sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help

我已经将客户端库路径添加到os环境变量中。 如果我从Pycharm IDE启动应用程序,效果会很好

我甚至在我的.wsgi文件中添加了以下行

sys.path.append('D:\FlaskDev\instantclient_11_2')

有人能帮忙吗?提前谢谢


Tags: mod数据库应用程序flaskwsgiserversqlalchemyapache