環境:
Windows7
Python 2.6.2
cx_Oracle 5.0.4
Oracle Instant Client 10.2.0
a)常規方法解壓Oracle Instant Client文件到指定目錄
b)設置環境變量
c)設置tnsnames.ora
d)pl/sql developer可以登錄遠程Oracle數據庫
安裝cx_Oracle,在python裏面import cx_Oracle,提示:
>>> import cx_Oracle
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cx_Oracle
ImportError: DLL load failed: 找不到指定的模塊。
網上搜索一番都在說複製oracle目錄的oci.dll等文件到$python_home/Lib/site-packages即可。
反覆嘗試未果。
偶見一網文說複製oci.dll到$python_home (比如c:/python26),將信將疑操作後發現竟然可以了。
特此記錄。