2014-05-05 88 views
1

我試圖在Windows 7 - 64位版本上安裝cx_Oracle。我以前有一個問題here關於在Windows上安裝cx_Oracle,我自己解決了這個問題;但它是Windows 7的32位版本;在這裏我遇到了一個安裝它的新問題。在Windows 64位安裝cx_Oracle時,命令'gcc'失敗,退出狀態爲1位

我應該提到我部署了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.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是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,可以很好地與這個客戶端配合任何想法這個安裝有什麼問題?

回答

2

其實你想下載cx_Oracle的二進制文件,在URL你指的

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一個)。

+0

是的,它實際上是解決方案。我對此很迷茫;也許是因爲我在32位版本的Windows中經歷的過程。順便說一句,謝謝你的答案。 –

相關問題