我使用 fastCGI 设置了 IIS,为烧瓶应用程序提供服务。到目前为止,一切都很好。接下来我想添加一些数据库连接,所以我将这一行添加import cx_Oracle
到我的应用程序中。现在抛出这个错误:
Error occurred while reading WSGI handler:
Traceback (most recent call last):
File "D:\Anaconda2\lib\site-packages\wfastcgi.py", line 791, in main
env, handler = read_wsgi_handler(response.physical_path)
File "D:\Anaconda2\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler
handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
File "D:\Anaconda2\lib\site-packages\wfastcgi.py", line 616, in get_wsgi_handler
raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
ValueError: "Bloomberg_server.app" could not be imported:
Traceback (most recent call last):
File "D:\Anaconda2\lib\site-packages\wfastcgi.py", line 600, in get_wsgi_handler
handler = __import__(module_name, fromlist=[name_list[0][0]])
File "D:\website\init__.py", line 6, in import cx_Oracle
ImportError: DLL load failed: The specified module could not be found. StdOut: StdErr:
正如标题所示,我无法在受控环境中重现该问题。相同的导入语句在 conda 环境中运行良好,此外,我可以在依赖数据库连接的页面上运行 Flask 调试服务器。
我不知所措。谁知道这里发生了什么?path/oracle_home 变量指向即时客户端,我只安装了一个 python 环境。