【发布时间】:2017-05-05 09:31:02
【问题描述】:
我想连接python和oracle 11g。 Python 版本 - 3.6.1 / 64 位,Windows 7 -64 位。
我已经从https://oracle.github.io/python-cx_Oracle/ 安装了 cx_Oracle 代码如下 -
import cx_Oracle
con = cx_Oracle.connect('sde/sde@orcl')
print (con.version)
con.close()
但我正在低于错误 -
C:\Python\Python36\python.exe
D:/Automation/Python_WP/practice/database/db_connection.py
Traceback (most recent call last):
File "D:/Automation/Python_WP/practice/database/db_connection.py", line 1, in <module>
import cx_Oracle
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1
请告诉我为 Windows-7 64 位连接 Python 3.6.1 和 Oracle 11g 的步骤。
【问题讨论】:
-
你是用pip安装的还是下载的?
-
我已经安装了cx_Oracle-5.3-11g.win-amd64-py3.6-2.exe (md5)。
-
使用 pip install cx_Oracle 并尝试。希望它能解决这个错误
-
C:\Python\Python36>pip install cx_Oracle 要求已经满足:c:\python\python36\lib\site-packages 中的 cx_Oracle
-
我也下载了Oracle Instant Client。 > 并解压。将此路径设置为 Environment Variable 。 ORACLE_HOME:C:\instantclient\instantclient 然后安装 cx_Oracle 但仍然无法正常工作。 ImportError:DLL 加载失败:找不到指定的模块。面临上述错误。
标签: python