我正在尝试cx_Oracle
在Windows 7-64位版本上安装。我以前在这里有一个关于cx_Oracle
在Windows上安装的问题,我自己解决了这个问题;但是它是Windows 7的32位版本;在这里,我遇到了安装它的新问题。
我应该提到,我还部署了64位版本的MinGW Microsoft Visual Studio 2008
。对于我俩command 'gcc' failed with exit status 1
。我easy_install cx_Oracle
在Microsoft Visual Studio 2008
控制台中尝试过,得到了以下输出(这是我从Windows默认命令行运行命令时确切得到的结果):
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>easy_install cx_Oracle
Searching for cx-Oracle
Reading http://pypi.python.org/simple/cx_Oracle/
Reading http://cx-oracle.sourceforge.net
Reading http://starship.python.net/crew/atuining
Best match: cx-Oracle 5.1.2
Downloading http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2.tar.gz?
download
Processing cx_Oracle-5.1.2.tar.gz
Writing c:\users\user\appdata\local\temp\easy_install-txvil3\cx_Oracle-5.1.2\set
up.cfg
Running cx_Oracle-5.1.2\setup.py -q bdist_egg --dist-dir c:\users\user\appdata\l
ocal\temp\easy_install-txvil3\cx_Oracle-5.1.2\egg-dist-tmp-pjitbi
In file included from C:\oracle\instantclient_11_2\sdk\include/oci.h:541:0,
from cx_Oracle.c:10:
C:\oracle\instantclient_11_2\sdk\include/oratypes.h:236:25: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'ubig_ora'
C:\oracle\instantclient_11_2\sdk\include/oratypes.h:237:25: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'sbig_ora'
In file included from C:\oracle\instantclient_11_2\sdk\include/oci.h:3045:0,
from cx_Oracle.c:10:
C:\oracle\instantclient_11_2\sdk\include/ociap.h:7459:40: error: unknown type na
me 'ubig_ora'
C:\oracle\instantclient_11_2\sdk\include/ociap.h:7471:36: error: unknown type na
me 'ubig_ora'
C:\oracle\instantclient_11_2\sdk\include/ociap.h:8278:23: error: unknown type na
me 'sbig_ora'
C:\oracle\instantclient_11_2\sdk\include/ociap.h:8278:46: error: unknown type na
me 'sbig_ora'
In file included from Connection.c:776:0,
from SessionPool.c:139,
from cx_Oracle.c:198:
Callback.c: In function 'Callback_BindByNameArgs':
Callback.c:73:15: warning: variable 'errorHandle' set but not used [-Wunused-but
-set-variable]
Callback.c:72:15: warning: variable 'bindHandlePtr' set but not used [-Wunused-b
ut-set-variable]
Callback.c: In function 'Callback_DefineByPosArgs':
Callback.c:120:15: warning: variable 'errorHandle' set but not used [-Wunused-bu
t-set-variable]
Callback.c:118:17: warning: variable 'defineHandle' set but not used [-Wunused-b
ut-set-variable]
Callback.c: In function 'Callback_ExecuteArgs':
Callback.c:158:15: warning: variable 'errorHandle' set but not used [-Wunused-bu
t-set-variable]
Callback.c:157:16: warning: variable 'serviceContextHandle' set but not used [-W
unused-but-set-variable]
Callback.c: In function 'Callback_FetchArgs':
Callback.c:181:15: warning: variable 'errorHandle' set but not used [-Wunused-bu
t-set-variable]
Callback.c: In function 'Callback_PrepareArgs':
Callback.c:206:15: warning: variable 'errorHandle' set but not used [-Wunused-bu
t-set-variable]
error: Setup script exited with error: command 'gcc' failed with exit status 1
我也尝试从源代码安装它python setup.py build --compiler=mingw32 install
,但出现了同样的错误。
我也试过easy_install http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi?download
; URL是cx_Oracle Windows amd64安装程序(Oracle 11g,Python 2.7)的sourceForge链接。我懂了:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>easy_install http://prdown
loads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi?download
Downloading http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win
-amd64-py2.7.msi?download
Processing cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi
error: Not a recognized archive type: c:\users\user\appdata\local\temp\easy_inst
all-ys4fjr\cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi
为了完整起见,我应该说,我在使用Oracle客户端11.我已设置PATH
和ORACLE_HOME
环境变量。我的计算机中的其他数据库应用程序(例如Navicat)与此客户端可以很好地协同工作。知道这个安装有什么问题吗?
实际上,您正在尝试在您引用的url中下载cx_Oracle的二进制文件
http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi
指向的文件是* .msi文件,代表Microsoft Installer,其中包含预编译的内容。因此,无需使用pip / easy_install来执行cx_Oracle的设置,只需双击msi文件即可。将安装所有需要的文件(.pyd和.so一个)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句