尽可能不要直接使用pip install cx_Oracle,这样默认安装的是最新版本的cx_Oracle,可能会出现如下错误html
解决方法:从 https://pypi.python.org/pypi/cx_Oracle/5.3 下载低版本cx_Oracle版本 能够下载cx_Oracle-5.3-11g.win-amd64-py3.6-2.exe ,而后直接安装python
能够经过执行这个文件来解决数据库
register.py 连接: https://pan.baidu.com/s/1GcPK_I7ddSLZkM2sv7AHtA 提取码: qrwm
windows
下载地址:https://www.oracle.com/technetwork/cn/topics/winx64soft-101515-zhs.htmloracle
下载好后解压,并配置环境变量测试
import cx_Oracle conn=cx_Oracle.connect('username','password','172.16.5.29:1521/ORCL') cursor=conn.cursor() print("链接成功!") cursor.close() conn.commit() conn.close()
当你看到“链接成功”的提示语句时,那么就恭喜你成功了用python连上了oracle数据库ui