【发布时间】:2020-11-22 13:37:59
【问题描述】:
【问题讨论】:
-
cx_Oracle大写为O。你试过import cx_Oracle吗?
标签: sql database pandas oracle cx-oracle
【问题讨论】:
cx_Oracle 大写为O。你试过import cx_Oracle吗?
标签: sql database pandas oracle cx-oracle
需要先导入包:
pip install cx-Oracle
【讨论】:
cx_Oracle ,带下划线 ;)
要在您自己的笔记本电脑上安装 cx_Oracle 最新版本 8.0.0,您需要已安装以下组件:
https://www.oracle.com/database/technologies/instant-client/downloads.html
在 Windows 上下载和安装适用于 Python 的 cx_Oracle 包的步骤。就我而言,我更喜欢 GitHub 中提供的版本
https://github.com/oracle/python-cx_Oracle
1.单击下载 cx_Oracle 链接从 Github 下载软件包。它会将一个 zip 文件下载到您的笔记本电脑中。
2.将 zip 文件解压缩到 Windows 上的文件夹中。例如,C:\cx_oracle。
3.现在打开命令提示符,将当前目录切换到C:\cx_oracle目录安装cx_Oracle包。
4.然后运行以下命令。
python -m pip install cx_Oracle --upgrade pip
它将在 Windows 上安装适用于 Python 的 cx_Oracle 包,您将收到如下所示的消息。
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 1.3MB 2.5MB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.0
重要提示如果您有多个版本的 Python,请使用与 Jupyter 笔记本关联的版本。
【讨论】:
简而言之,anaconda 用户
安装包时使用小写字母source
conda install -c conda-forge cx_oracle
现在在导入包时使用 init cap as
import cx_Oracle
【讨论】: