在Windows 64位上安装cx_Oracle时,命令'gcc'失败,退出状态为1 [英] command 'gcc' failed with exit status 1 while installing cx_Oracle on windows 64 bit
问题描述
我正在尝试在Windows 7-64位版本上安装 cx_Oracle
。我以前在此处遇到有关安装 cx_Oracle
在Windows上,我自己解决了这个问题;但是它是Windows 7的32位版本;在这里,我遇到了安装它的新问题。
I'm trying to install cx_Oracle
on my Windows 7 - 64 bit version. I previously had a question here about installing cx_Oracle
on Windows and I solved the issue by myself; but it was a 32 bit version of Windows 7; here I faced a new problem installing it.
我应该提到我部署了64位版本的MinGW,还部署了 Microsoft Visual Studio 2008
。对于这两个命令,我都遇到了命令'gcc'失败,退出状态为1
。我在 Microsoft Visual Studio 2008
控制台中尝试了 easy_install cx_Oracle
,我得到了此输出(这正是我刚得到的内容从Windows默认命令行运行命令):
I should mention that I deployed 64 bit version of MinGW and also Microsoft Visual Studio 2008
. For both I got command 'gcc' failed with exit status 1
. I tried easy_install cx_Oracle
in Microsoft Visual Studio 2008
console and I got this output (it is what I exactly got when I ran the command from windows default command line):
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
,我遇到了相同的错误。
I also tried to install it from source with python setup.py build --compiler=mingw32 install
and I got the same error.
我也尝试了 easy_install http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi?download
; URL是sourceForge的cx_Oracle Windows amd64安装程序(Oracle 11g,Python 2.7)的链接。我知道了:
I also tried easy_install http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g.win-amd64-py2.7.msi?download
; the URL is sourceForge's link for cx_Oracle Windows amd64 Installer (Oracle 11g, Python 2.7). I got this:
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
为了完整起见,我应该说m使用oracle Instant Client11。我设置了 PATH
和 ORACLE_HOME
环境变量。我的计算机中的其他数据库应用程序(例如Navicat)与此客户端可以很好地协同工作。知道这个安装有什么问题吗?
For completeness, I should say that I'm using oracle instant client 11. I have set PATH
and ORACLE_HOME
environment variables. Other database apps like Navicat in my machine work well with this client. Any idea what's wrong with this installation?
推荐答案
实际上,您正在尝试从URL中下载cx_Oracle的二进制文件。重新引用
Actually you're trying to download the binary of cx_Oracle, in the url you're refering to
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一个)。
the pointed file is a *.msi one which stands for Microsoft Installer and contains the pre-compiled stuff. So instead of using pip/easy_install to perform the setup of cx_Oracle, just double click on the msi file; that will install all the needed files (the .pyd and the .so one).
这篇关于在Windows 64位上安装cx_Oracle时,命令'gcc'失败,退出状态为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!