【问题标题】:How to connect remote Oracle database in Django without Oracle installation on current server?如何在没有在当前服务器上安装 Oracle 的情况下在 Django 中连接远程 Oracle 数据库?
【发布时间】:2016-04-23 21:52:02
【问题描述】:

我想用 Django 连接到 Oracle 数据库。它需要 cx_Oracle 模块。当我尝试安装 cx_Oracle 时,需要在当前服务器上安装 Oracle。

[root@localhost cx_Oracle-5.2]# /opt/python2.7/bin/python setup.py install
Traceback (most recent call last):
  File "setup.py", line 170, in <module>
    raise DistutilsSetupError("cannot locate an Oracle software " \
distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation

但实际上我在这台服务器上不需要 Oracle,我的 Oracle 服务器是远程的。我该如何解决这个问题?

【问题讨论】:

  • 当然你只需要 oracle 客户端库。不是所有的软件,只是客户端软件。

标签: python django oracle oracle11g cx-oracle


【解决方案1】:

您需要安装Oracle Instant Client

cx_Oracle 使用它来连接到您的数据库。

【讨论】:

  • 对于 Linux(我的要求),您可以下载它here。需要一个 oracle 帐户/登录名(免费)。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多