我做错了什么? cx_Oracle安装错误

发布于 2025-01-16 21:45:03 字数 399 浏览 3 评论 0原文

您好,我正在尝试将 Python jupyter 连接到我的 Oracle sql 开发人员。 请有人告诉我我做错了什么。

  1. 安装cx_Oracle pip 安装 cx_Oracle 成功!!!

  2. 我去Oracle Instant Client下载了Basic包instant client 21_3版本并解压并保存在C盘

  3. 复制Oracle即时客户端21_3路径并粘贴到环境变量中

  4. 导入cx_Oracle Conn=cx_Oracle(...详细信息) 错误为 DPI-1047 无法找到 64 位 Oracle 客户端库。

老实说,我不知道我做错了什么,所有教程视频都很混乱,请已经成功完成此操作的人请帮助我。

Hi I'm trying to connect Python jupyter to my Oracle sql developer.
Please please someone tell me what I'm doing wrong.

  1. Install cx_Oracle
    pip install cx_Oracle
    Success!!!

  2. I went to Oracle Instant Client and downloaded Basic package instant client 21_3 version and unziped and saved in c drive

  3. Copy the Oracle instant client 21_3 path and pasted in environment variable

  4. Import cx_Oracle
    Conn=cx_Oracle(...details)
    Error is DPI-1047 Cannot locate a 64-bit Oracle Client library.

I honestly cannot tell what im doing wrong and all the tutorial videos are so confusing please please someone who already did this successfully please help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云胡 2025-01-23 21:45:03

您必须初始化 cx_Oracle 以告诉它依赖项在哪里。例如:

import cx_Oracle

CONFIG = {
    'user': 'hr',
    'password': 'oracle',
    'dsn': 'localhost/orcl'
}
cx_Oracle.init_oracle_client(lib_dir='<your path>/instantclient_19_8')

with cx_Oracle.connect(**CONFIG) as conn:

……等等

You have to initialise cx_Oracle to tell it where the dependencies are. For example:

import cx_Oracle

CONFIG = {
    'user': 'hr',
    'password': 'oracle',
    'dsn': 'localhost/orcl'
}
cx_Oracle.init_oracle_client(lib_dir='<your path>/instantclient_19_8')

with cx_Oracle.connect(**CONFIG) as conn:

...and so forth

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文