【问题标题】:ImportError when importing cx_Oracle python导入 cx_Oracle python 时出现 ImportError
【发布时间】:2017-03-04 01:12:57
【问题描述】:

ImportError:DLL 加载失败:%1 不是有效的 Win32 应用程序。我研究了2天,但无法解决。需要帮助!!

【问题讨论】:

    标签: python python-2.7 cx-oracle


    【解决方案1】:

    您可能会收到此错误的原因有很多,但您的问题确实没有足够的信息。您在标题中提到了 cx_Oracle,但您确定已正确安装它吗?例如,cx_Oracle 网站提到:

    pip install cx_Oracle在 Windows 以外的平台上)或下载 直接来自 PyPI。

    这个答案可能会有所帮助:easy_install cx_Oracle (python package) on Windows

    【讨论】:

      【解决方案2】:

      确保您的 Python、cx_Oracle 和 Oracle 客户端全部为 64 位或全部为 32 位。如果其中一个不同,您可能会收到此错误。

      【讨论】:

      • 我的 python 2.7 是 64 位 (AMD 64) 但我不确定我是否安装了正确的 cx_Oracle 如何检查?
      • 确保您从 PyPI (pypi.python.org/pypi/cx_Oracle/5.2.1) 下载并安装了名称为 amd64 的版本。但是,如果您在 Windows 上,如果您安装了错误的版本,它应该会抱怨。但是,如果您只是将其复制进去,则可以做到这一点。此外,请确保您使用的是 64 位版本的 Oracle Instant Client。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-01
      • 2017-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多