命令“GCC”失败,退出状态1,而在Windows上安装cx_Oracle 64位(command

2019-10-20 01:31发布

我试图安装cx_Oracle在我的Windows 7 - 64位版本。 我以前有一个问题在这里关于安装cx_Oracle在Windows和我自己解决问题; 但它的Windows 7 32位版本; 在这里,我遇到了新的问题安装。

我要指出,我部署的MinGW的64位版本,也Microsoft Visual Studio 2008 。 对于这两个我得到command 'gcc' failed with exit status 1 。 我试过easy_install cx_OracleMicrosoft 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 ; 网址是SourceForge的链接,cx_Oracle的Windows AMD64安装程序(的Oracle 11g,Python 2.7版)。 我懂了:

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.我已设置PATHORACLE_HOME环境变量。 其他数据库应用程序,如Navicat的在我的机器与此客户端很好地工作。 任何想法有什么不对安装吗?

Answer 1:

其实你想下载cx_Oracle的二进制文件,在你指的网址

http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi

尖头文件是*的.msi其中一个代表Microsoft安装程序,并包含预编译的东西。 因此,而不是使用PIP / easy_install的执行cx_Oracle,只是msi文件,双击的设置; 将安装所有必要的文件(.pyd和。所以一个)。



文章来源: command 'gcc' failed with exit status 1 while installing cx_Oracle on windows 64 bit