TypeError:不支持的Python数据类型:file
:
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.
:
^{pr2}$指this question。问题仍然存在。我使用的是Windows 7 64位PC。我如何解决这个问题?在
检查您使用的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的版本。每件事都必须匹配,否则你会发现你注意到的问题。在
相关问题 更多 >
编程相关推荐