0
我有IIS設置與fastCGI,服務燒瓶應用程序。到現在爲止還挺好。接下來我想添加一些數據庫連接,所以我添加import cx_Oracle
行到我的應用程序。現在引發這個錯誤:wfastcgi失敗導入cx_Oracle,但`python -c「導入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環境。