安装出错:
distutils.errors.DistutilsSetupError: cannot locate Oracle include files in
或者运行出错:
cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle
均可参考该文章
环境:
windows10(同样适用于windows7,8),python2.7
1.下载cx_Oracle
在windows下不要使用easy_install或者pip,因为这样安装不会同步环境,并报错:
distutils.errors.DistutilsSetupError: cannot locate Oracle include files in...
因此下载.exe文件安装
https://pypi.python.org/pypi/cx_Oracle 下载cx_Oracle-5.2.1-12c.win-amd64-py2.7.exe (md5)
2.下载Oracle Instant Client
去http://www.oracle.com/technetwork/topics/winx64soft-089540.html下载 instantclient-basic-windows.x64-12.1.0.2.0.zip
下载后解压到某一路径,并将该路径添加到系统的环境变量,命名为ORACLE_HOME,将ORACLE_HOME添加到path下,否则会报错
cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle