pla*_*que 6 python oracle python-3.x anaconda conda
我需要在 Python Anaconda3-2.5.0-Windows-x86_64 中连接到 Oracle 数据库。通过以下方式安装 cx_Oracle 模块:
conda install -c https://conda.anaconda.org/anaconda cx_oracle
Run Code Online (Sandbox Code Playgroud)
失败并显示以下输出(已修剪):
Hint: the following packages conflict with each other:
- cx_oracle
- python 3.5*
Run Code Online (Sandbox Code Playgroud)
因此,我尝试通过https://pypi.python.org/pypi/cx_Oracle/ 中的“cx_Oracle-5.2.1-11g.win-amd64-py3.5.exe”安装 Python 3.5 软件包,这似乎正在运行(不知何故)。甚至“conda list”命令也会打印行:
cx-oracle 5.2.1 <pip>
Run Code Online (Sandbox Code Playgroud)
但是当我输入import cx_Oracle;Python 时
ImportError: DLL load failed: Uvedený modul nebyl nalezen.
Run Code Online (Sandbox Code Playgroud)
出现。最后一个本地化部分的粗略翻译是“找不到模块”。
如何安装 cx_Oracle 模块?或者有没有其他方法可以连接到Oracle数据库?
我假设你只安装了 windows 和 python 3.5。检查你的 anaconda 以防万一,确保你使用的是 anaconda3 或者 anaconda 设置了 python3 环境。假设所有检查均已完成,并且您仍然遇到相同的错误,请尝试从 pip 全新安装 cx_oracle。
在你的 Windows 机器上打开 cmd 并输入pip install cx_Oracle,它应该可以很好地安装。如果你碰巧也安装了 python2,你可能想要这样做python3 -m pip install cx_Oracle。安装完成后,您应该可以开始使用了。