【Django 问题解决】Oracle数据库报错:cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library..

环境

macOS
Python 3.7
Django 2.1
cx_Oracle 7.1

问题

在配置 settings.py 文件时候,执行 python manager.py 报错:

cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded..."dlopen(libclntsh.dylib, 1): image not found". See https://oracle.github.io/odpi/doc/installation.html#macos for help

解决方法其实就在后面: https://oracle.github.io/odpi/doc/installation.html#macos for help.

解决

打开URL: https://oracle.github.io/odpi/doc/installation.html#macos
找到macos的部分。
按照步骤执行。

注意: 我下载的 instantclient-basic-macos.x64-11.2.0.4.0.zip , 因此后面的步骤一定要按照11.2的步骤严格执行。

最后,重新启动Django服务器,问题解决。

你可能感兴趣的:(Django)