使用 cx_Oracle 时,是否需要在所有装有 python 应用程序的计算机上安装 Oracle?

When using cx_Oracle does Oracle need to be installed on all computers with the python application?

我创建了我的程序的 exe,它使用 cx_Oracle 与 oracle 数据库通信以创建 excel 工作表。如果其他人使用此 exe,他们是否需要安装 Oracle?

任何使用 cx_Oracle 运行 Python 程序的计算机都需要安装 'Oracle client'。这是 cx_Oracle 需要的允许连接到数据库的一组 Oracle 库。数据库可以位于远程计算机上。 Oracle 客户端库可用于三种不同的安装:

  • 安装 Oracle 数据库
  • 使用 'full' Oracle 客户端安装
  • 来自 Oracle Instant Client

您的情况最常见的是使用 Oracle Instant Client,它相对较小且易于安装。

您下载与您的操作系统和 Python 架构(32 位或 64 位)相匹配的 Instant Client 'Basic' 包。解压它。将您的操作系统搜索路径设置为您解压缩的目录,例如 PATH(在 Windows 上)或 LD_LIBRARY_PATH 或 ldconfig(在 Linux 上)。

即时客户端下载和说明位于 https://www.oracle.com/database/technologies/instant-client.html

cx_Oracle 安装说明位于 https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html