【发布时间】:2019-02-02 03:32:33
【问题描述】:
我在使用即时客户端时遇到问题。我按照http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html#ic_osx_inst 中的确切说明在 macOS 上安装 Instant Client 11.2。
但是,在命令行中启动服务器时,它会返回以下错误: DatabaseError:DPI-1047:无法加载 64 位 Oracle 客户端库:“dlopen(libclntsh.dylib,
您的 Python 版本是多少?它是 32 位还是 64 位? 64 位
您的 cx_Oracle 版本是多少? 今天的最新版本,我相信是6.4.1
究竟是什么命令导致了问题(例如,您尝试使用什么命令进行安装)? 执行此命令“python manage.py”运行应用程序时
您看到了什么错误?
DatabaseError:DPI-1047:无法加载 64 位 Oracle 客户端库:“dlopen(libclntsh.dylib, 1): image not found”。见https://oracle.github.io/odpi/doc/installation.html#macos
在我的 bash 个人资料中,我已经建立了这些:
export PATH="/usr/local/mysql/bin:$PATH"
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
export WORKON_HOME=$HOME/Virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export VIRTUALENVWRAPPER_PYTHON=/usr/local/Cellar/python@2/2.7.15_1/bin/python2.7
export VIRTUALENVWRAPPER_VIRTUALENV=usr/local/Cellar/python@2/2.7.15_1/bin/virtualenv
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export TNS_ADMIN=/usr/local/oracle/instantclient_11_2
source /usr/local/bin/virtualenvwrapper.sh
export PATH="/usr/local/opt/gettext/bin:$PATH"
if [ -f $(brew --prefix)/etc/bash_completion ]; then
source $(brew --prefix)/etc/bash_completion
fi
export PATH=~/instantclient_11_2:$PATH
# Setting PATH for Python 2.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
【问题讨论】:
-
" 在命令行中启动服务器时..." - 你在启动什么 server?究竟如何?您的 StackOverflow 背景 并不丰富,因此我无法确定您是否知道自己在做什么(我不是要侮辱您!)。因为,当说“服务器”时,对我来说听起来好像你想启动你的 Oracle 数据库。好吧,Oracle(即时)客户端不是数据库(服务器)。它只是一堆允许您使用数据库的程序。客户端包含更多,即时客户端没有那么多。你能解释一下你在做什么吗?对不起,如果我误解了这个问题。
-
@Littlefoot 我正在启动 nginx 服务器。正如您在 bash 配置文件中看到的那样,我使用“Python 2.7”作为编程语言。我想知道该错误的可能原因。
-
啊哈。显然,我确实误解了这个问题。我对“nginx服务器”一无所知(不管是什么)。我希望其他人能够提供帮助。
-
看起来您只是没有找到主要的 Oracle 客户端动态库。我没有在 Mac 上使用过 Oracle 客户端,但在 Windows 和 Linux 上这种事情一直在发生,所以你只需要正确设置路径和环境变量。
标签: bash oracle cx-oracle instantclient