oracle 如何将 cx_Oracle 包安装到 Anaconda 3 以与 python 3.5 一起使用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35506441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I instal cx_Oracle package to Anaconda 3 to use with python 3.5
提问by plastique
I need to connect to Oracle database in Python Anaconda3-2.5.0-Windows-x86_64. Installation of the cx_Oracle module by:
我需要在 Python Anaconda3-2.5.0-Windows-x86_64 中连接到 Oracle 数据库。通过以下方式安装 cx_Oracle 模块:
conda install -c https://conda.anaconda.org/anaconda cx_oracle
fails with following output (trimmed):
失败并显示以下输出(已修剪):
Hint: the following packages conflict with each other:
- cx_oracle
- python 3.5*
So I tried to install package for Python 3.5 by 'cx_Oracle-5.2.1-11g.win-amd64-py3.5.exe' from https://pypi.python.org/pypi/cx_Oracle/Which seems to be working (somehow). Even 'conda list' command prints line:
因此,我尝试通过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>
But when I enter import cx_Oracle;
in Python then
但是当我输入import cx_Oracle;
Python 时
ImportError: DLL load failed: Uvedeny modul nebyl nalezen.
appears. Rough translation of last localized part is 'Modul not found.'
出现。最后一个本地化部分的粗略翻译是“找不到模块”。
How can I install the cx_Oracle module? Or is there any other way to connect to Oracle database?
如何安装 cx_Oracle 模块?或者有没有其他方式连接到Oracle数据库?
回答by Seekheart
I'm assuming that you have windows and python 3.5 only installed. Check your anaconda just incase to make sure you are using anaconda3 or that anaconda is setup with python3 environment. Assuming all that checks out and you are still getting that same error try doing a fresh install of cx_oracle from pip.
我假设您只安装了 windows 和 python 3.5。检查您的 anaconda 以确保您使用的是 anaconda3 或 anaconda 是使用 python3 环境设置的。假设所有这些检查出来并且您仍然遇到相同的错误,请尝试从 pip 重新安装 cx_oracle。
On your windows machine open up cmd and type pip install cx_Oracle
and it should install nicely. If you by chance have python2 installed as well you might want to do python3 -m pip install cx_Oracle
. After installation completes you should be good to go.
在你的 Windows 机器上打开 cmd 并输入pip install cx_Oracle
,它应该安装得很好。如果您碰巧也安装了 python2,您可能想要执行python3 -m pip install cx_Oracle
. 安装完成后,您应该可以开始使用了。
回答by Beege
In the Anaconda navigator, select 'Environments', then on the right, change the filter to 'All'. Now you can query for 'cx_oracle', select it and at the bottom, select 'Apply'. Once completed, you should be able to
在 Anaconda 导航器中,选择“环境”,然后在右侧将过滤器更改为“全部”。现在您可以查询“cx_oracle”,选择它,然后在底部选择“应用”。完成后,您应该能够
import oracle
回答by Phoenix87
Download a precompiled version of the package and install it using easy_install
.
下载包的预编译版本并使用easy_install
.
回答by kalaisejiane Athmalingame
Easier way to load is to down load from the below link https://pypi.python.org/pypi/cx_Oracle/
更简单的加载方法是从以下链接 https://pypi.python.org/pypi/cx_Oracle/ 下载
and install it in Windows. It worked like a charm for me.
并将其安装在 Windows 中。它对我来说就像一种魅力。