我试图在我的Windows 7 – 64位版本上安装cx_Oracle 。 我以前有一个关于在Windows上安装cx_Oracle的问题,我自己解决了这个问题; 但它是Windows 7的32位版本; 在这里我遇到了安装它的新问题。
我应该提到,我部署了64位版本的MinGW和Microsoft Visual Studio 2008 。 对于我得到command 'gcc' Failed with exit status 1 。 我尝试了Microsoft Visual Studio 2008控制台中的easy_install cx_Oracle ,并得到了这个输出(这正是我从Windows默认命令行运行命令时所得到的):
Setting environment for using Microsoft Visual Studio 2008 x86 tools. C:Program Files (x86)Microsoft Visual Studio 9.0VC>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:usersuserappdatalocaltempeasy_install-txvil3cx_Oracle-5.1.2set up.cfg Running cx_Oracle-5.1.2setup.py -q bdist_egg --dist-dir c:usersuserappdatal ocaltempeasy_install-txvil3cx_Oracle-5.1.2egg-dist-tmp-pjitbi In file included from C:oracleinstantclient_11_2sdkinclude/oci.h:541:0,from cx_Oracle.c:10: C:oracleinstantclient_11_2sdkinclude/oratypes.h:236:25: error: expected '=',',';','asm' or '__attribute__' before 'ubig_ora' C:oracleinstantclient_11_2sdkinclude/oratypes.h:237:25: error: expected '=','asm' or '__attribute__' before 'sbig_ora' In file included from C:oracleinstantclient_11_2sdkinclude/oci.h:3045:0,from cx_Oracle.c:10: C:oracleinstantclient_11_2sdkinclude/ociap.h:7459:40: error: unkNown type na me 'ubig_ora' C:oracleinstantclient_11_2sdkinclude/ociap.h:7471:36: error: unkNown type na me 'ubig_ora' C:oracleinstantclient_11_2sdkinclude/ociap.h:8278:23: error: unkNown type na me 'sbig_ora' C:oracleinstantclient_11_2sdkinclude/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链接。 我懂了:
cx_Oracle无法识别在Linux上安装Oracle软件安装的位置
在Windows上easy_install cx_Oracle(python包)
如何让cx_Oracle在64位Itanium Windows上工作?
在Windows中部署cx_Oracle
识别PyDev中的cx_Oracle安装
C:Program Files (x86)Microsoft Visual Studio 9.0VC>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:usersuserappdatalocaltempeasy_inst all-ys4fjrcx_Oracle-5.1.2-11g.win-amd64-py2.7.msi
为了完整起见,我应该说我正在使用oracle即时客户端11.我已经设置了PATH和ORACLE_HOME环境variables。 其他数据库应用程序,如我的机器中的Navicat,可以很好的与这个客户端一起工 任何想法这个安装有什么问题吗?
如何连接到Oracle中去
在Linux上安装cx_Oracle的问题 – 只从Site-Packages目录导入
其实你试图下载cx_Oracle的二进制文件,在你指的网址
http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi
指向的文件是一个* .msi代表微软安装程序,并包含预编译的东西。 因此,不要使用pip / easy_install来执行cx_Oracle的设置,只需双击msi文件; 这将安装所有需要的文件(.pyd和.so一个)。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。