在Windows 7上安装cx®Oracle时出错

2024-09-27 22:21:51 发布

您现在位置:Python中文网/ 问答频道 /正文

TypeError:不支持的Python数据类型:file

Spyder console error

In [9]: import cxOracle
Traceback (most recent call last):

  File "<ipython-input-9-d1ecebcba3d2>", line 1, in <module>
    import cx_Oracle

ImportError: DLL load failed: %1 is not a valid Win32 application.

Command prompt error

^{pr2}$

this question。问题仍然存在。我使用的是Windows 7 64位PC。我如何解决这个问题?在


Tags: inimportmostinputipythoncallfilelast
1条回答
网友
1楼 · 发布于 2024-09-27 22:21:51

检查您使用的Python类型是32位还是64位。然后转到PyPI(https://pypi.python.org/pypi/cx_Oracle/5.2.1)并下载正确的版本(正确的Python版本,32位或64位取决于您使用的Python)。预构建的二进制文件应该可以帮助您解决第一个问题。在

您还需要确保安装了Oracle客户机,并且它在您的路径中。您可以从这个位置(http://www.oracle.com/technetwork/database/features/instant-client/index.html)获取Oracle instant客户端,并按照该页上的说明进行操作。同样,请确保下载32位或64位,具体取决于您使用的Python和cx_Oracle的版本。每件事都必须匹配,否则你会发现你注意到的问题。在

相关问题 更多 >

    热门问题