包:cx_Oracle 用于 Python 3.5,windows64 位。甲骨文 11.2.0.1.0

Package : cx_Oracle for Python 3.5, windows64 bit. Oracle 11.2.0.1.0

我正在尝试在我的 windows PC 上安装 cx_Oracle。我 运行 在命令提示符下执行以下命令:

pip install cx_Oracle

这给我以下错误:

Collecting cx-Oracle
Could not find a version that satisfies the requirement cx-Oracle (from versions: )
No matching distribution found for cx-Oracle

我正在使用 windows 64 位 机器和 Python 3.5(Anaconda3)。我电脑上安装的 Oracle vcersion 是 Oracle 11.2.0.1.0 和 oracle-instantclient 版本 oracle- instantclient-11.2.0.4.0-0

请让我知道我错过了什么。我应该将 python 版本降级到 3.4 吗?如果是,那么如何在 Anaconda 中使用命令行来完成?

我按照以下步骤解决了这个问题:

创建 Python 3.4 环境

Windows+R打开运行

键入 'cmd' (无撇号)并按回车键打开命令提示符。

键入以下内容:

$ conda create -n py34 python=3.4 anaconda

激活并更新新环境

$ activate py34    
$ conda update conda

卸载并重新安装 Spyder 的 qt 方面

此步骤修复了尝试从 py34 环境打开时 Spyder 的 qt 问题

$ conda remove qt --name py34 
$ conda install qt=4.8.7=vc10_4

测试

确保您的 py34 环境已激活。

$ spyder # will launch spyder

在 Spyder 的交互式控制台中键入:

$ import cx_Oracle # the O in Oracle must be capitalized

如果没有报错,大功告成!

我的解决方案主要是根据以下帖子找到的:

http://conda.pydata.org/docs/py2or3.html
https://github.com/spyder-ide/spyder/issues/2858

Python cx_Oracle 的 3.5 二进制文件已于 1 月 18 日发布。参见此处:

https://pypi.python.org/pypi/cx_Oracle/