python-2.7 - 在 Windows 上安装 cx_Oracle 时出错

标签 python-2.7 cx-oracle

我正在尝试在 Windows 中安装 python 的 cx_Oracle 模块。 我不断收到下面提到的错误:无法找到 Oracle 软件安装

我需要什么样的 Oracle 软件才能使 cx_Oracle 模块工作?

------------------------------------------------------------ ----------------------

C:\Users\ndhaka.ORADEV>pip install cx_Oracle
Downloading/unpacking cx-Oracle
Running setup.py (path:c:\users\ndhaka~1.ora\appdata\local\temp\pip_build_ndhaka\cx-Oracle\setup.py) egg_info for package cx-Oracle
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "c:\users\ndhaka~1.ora\appdata\local\temp\pip_build_ndhaka\cx-Oracle\setup.py", line 135,in <module>
    raise DistutilsSetupError("cannot locate an Oracle software " \
distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

文件“”,第 17 行,位于

文件“c:\users\ndhaka~1.ora\appdata\local\temp\pip_build_ndhaka\cx-Oracle\setup.py”,第 135 行,位于

raise DistutilsSetupError("cannot locate an Oracle software " \

distutils.errors.DistutilsSetupError:无法找到 Oracle 软件安装


清理中... 命令 python setup.py Egg_info 在 c:\users\ndhaka~1.ora\appdata\local\temp\pip_build_ndhaka\cx-Oracle 中失败,错误代码为 1 将失败的调试日志存储在 C:\Users\ndhaka.ORADEV\pip\pip.log

最佳答案

您需要在计算机上安装 Oracle 客户端,因为 cx_Oracle 只是 Python 和 Oracle 客户端之间的桥梁。 我遇到了同样的问题,并通过从 here 安装即时客户端解决了我的问题 请确保您的系统安装兼容版本(32位或64位)

按照此链接中的所有步骤操作,您将在计算机中完美安装 cx_Oracle 模块。 link

关于python-2.7 - 在 Windows 上安装 cx_Oracle 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25802178/

相关文章:

python - QTableView 中 Drop-Events 的 EventFilter

python - 如何在不下载文件的情况下获取重定向的 URL

python - PyGame Space Invaders 游戏 - 让外星人一起移动

python - sqlalchemy 1.1.10 oracle 连接错误

python - 问题构建 cx_Oracle - libclntsh.so.11.1 => 未找到

python - 在Python中反转字符串的一部分

python - 为什么浮点字典键可以用相同的值覆盖整数键?

python - 导入 cx_Oracle 和 kinterbasdb 返回错误

python - 我尝试在 VS code 中安装 cx_Oracle 并收到错误 Microsoft Visual C++ 14.0 或更高版本是必需的

python - Cx_Oracle (Python3.6) SQL 查询 GROUP BY 导致 ValueError - 在 SQL Developer 中运行良好