【问题标题】:cx_oracle and oracle 7?cx_oracle 和 oracle 7?
【发布时间】:2010-10-26 12:22:17
【问题描述】:

在工作中,我们有 Oracle 7。我想使用 python 来访问数据库。 有没有人这样做或知道怎么做? 我有 Windows XP、Python 2.6 和用于 python 2.6 的 cx_oracle 版本

但是,当我尝试导入 cx_oracle 时,我收到以下错误:

ImportError: DLL load failed the module could not be found

感谢任何帮助!

马特

【问题讨论】:

    标签: python cx-oracle


    【解决方案1】:

    cx_Oracle 目前仅提供与 9i、10g 和 11i 客户端的链接。安装其中一个客户端并将其配置为使用正确的 ORACLE_SID 连接到 Oracle 7 数据库。

    【讨论】:

    • 好的。我们现在有 9i,但我仍然收到相同的错误“ImportError:DLL 加载失败”Oracle:9i Python:2.6 Windows:XP SP2 cxOracle:5.01-py2.6 再次非常感谢您的帮助!感谢您的 cmets!
    • 使用像 [Dependency Walker][1] 这样的工具来追踪丢失的 DLL。 [1]:dependencywalker.com
    • cx_Oracle 4.4.1 似乎是支持 9i 的最新版本。
    【解决方案2】:

    确保您有 oracle .dll 的位置(o 文件在 PATH 环境变量中设置。包含 oci.dll 的位置就足够了。

    【讨论】:

      【解决方案3】:

      我在工作中遇到了同样的问题。我终于放弃了尝试使用 cx_Oracle 并选择了adodbapi。它适用于 Oracle 8。

      【讨论】:

        【解决方案4】:

        如果您配置了 ODBC,则可以使用它。它可用于 ActivePython 或作为 win32 扩展。您将获得与:

        connection = odbc.odbc('db_alias/user/passwd')
        

        您可以选择使用 Jython 和瘦 JDBC 客户端。不需要安装客户端。使用 Jython,您可以通过 db url 访问 db:

        db = DriverManager.getConnection(db_url, usr, passwd)
        

        db_url 的样子:

        jdbc:oracle:thin:user/passwd@machine_ip:port:dbname
        

        【讨论】:

          猜你喜欢
          • 2022-11-29
          • 2021-06-09
          • 2011-06-28
          • 2016-06-01
          • 2018-08-12
          • 2020-12-02
          • 2020-08-10
          • 2010-09-19
          • 2013-03-22
          相关资源
          最近更新 更多