使用cx_Oracle在python中连接oracle时出错 [英] error when connecting oracle in python using cx_Oracle

查看:377
本文介绍了使用cx_Oracle在python中连接oracle时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用如下所示的python连接oracle数据库.

I was trying to connect oracle database using python like below.

import cx_Oracle
conn = cx_Oracle.connect('user/password@host:port/database')

连接oracle时遇到错误. DatabaseError:DPI-1047:无法加载64位Oracle Client库:"libclntsh.so:无法打开共享库文件:没有这样的文件或目录".参见 https://oracle.github.io/odpi/doc/installation.html #linux 寻求帮助.

I've faced an error when connecting oracle. DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help.

我一直在努力找出答案.例如,我使用了用户名,密码,主机,端口和数据库('orcl'),

I've been struggling to figure it out. I used my user name, password, host, port and database('orcl') for example,

'admin/admin@10.10.10.10:1010/orcl'.

为什么不能连接?

啊,顺便说一句,我正在运行azure笔记本中的所有代码.

Ahh, btw I'm running all the code in azure notebooks.

推荐答案

该错误表明您缺少64位Oracle客户端安装或未正确配置.查看错误消息中提到的链接.它将提供有关如何执行Oracle客户端安装和配置的说明.

That error indicates that you are missing a 64-bit Oracle client installation or it hasn't been configured correctly. Take a look at the link mentioned in the error message. It will give instructions on how to perform the Oracle client installation and configuration.

这篇关于使用cx_Oracle在python中连接oracle时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆