1、cx_Oracle.DatabaseError: ORA-24315: illegal attribute type
2、cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle
Python通過cx_Oracle模組連線oracle資料庫報如上錯誤,都是應為oracle客戶端的問題導致,只需要將對應版本的*.dll(10g:oci.dll, oraociei10.dll, oraocci10.dll;11g:oci.dll, oraociei11.dll, oraocci11.dll)檔案拷貝至
C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Lib\site-packages下或者C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\site-packages下
即可解決。
注:cx_oracle下載地址:https://pypi.python.org/pypi/cx_Oracle/5.3
oracle客戶端下載地址:https://www.oracle.com/database/technologies/instant-client/downloads.html