cx_Oracle ImportError: DLL load failed: 找不到指定的模塊 解決

環境:

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),將信將疑操作後發現竟然可以了。

特此記錄。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章