pycharm 使用cx_Oracle报DPI-1047错误

 

执行程序报错:

cx_ORAcle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "E:\app\Administrator\product\11.2.0\client_2\bin\oci.dll is not the correct architecture". See https://oracle.github.io/odpi/doc/installation.html#windows for help

 

解决:需要安装个32bit的Python,如果不想破坏原来安装的,可以额外设置个目录安装32bit的python,然后在Pycharm中设置当前工程加载的版本:file->settings->projectInterpreter 选择32位的python,再运行就不会报错了

pycharm 使用cx_Oracle报DPI-1047错误