如何使cx_Oracle在64位Itanium Windows上运行? [英] How do I get cx_Oracle to work on 64-bit Itanium Windows?

查看:171
本文介绍了如何使cx_Oracle在64位Itanium Windows上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在64位Itanium服务器上运行Windows Server 2003,该服务器还运行64位Oracle 10.2,并且我想为Python 2.5安装cx_Oracle。我曾经在Windows和Linux上使用过cx_Oracle多次,而且我也曾经在32位版本的平台上对其进行过编译,但是我从未尝试过IA64编译。



cx_Oracle的二进制构建均不位于 http://cx-oracle.sourceforge.net/ 是64位的,尝试运行 import cx_Oracle 时,在安装它们中的任何一个后出现错误,所以我认为要做的是从源代码进行编译



运行 python setup.py build 时,我得到的错误是Python是使用Visual Studio 2003和我需要可以产生兼容二进制文件的东西。我有Visual Studio 2005,由于链接到其他版本的C标准库,以及其他一些原因,它显然不符合要求。不幸的是,Visual Studio 2003不再可供下载,我不确定从哪里获得。



所以我从 http://sourceforge.net/projects/mingw/files/ ,但这也仅提供32位格式。我继续尝试尝试一下,但是在编译过程中它给了我一个有关我链接的Oracle DLL的错误,以防止文件格式无效。



在这一点上,我有很多选择,而且我不确定在哪里下功夫。


  1. I可以从 http://sourceforge.net/projects/mingw-w64/并尝试使用它,只是它似乎只能作为源代码使用,所以我不得不使用Visual Studio 2005编译编译器。


  2. <我可以尝试使用x86 32位版本的Python,然后从> http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html ,然后使用它来构建cx_Oracle。我可能必须将我的ORACLE_HOME设置为客户端,这样它才不会尝试针对64位服务器DLL进行链接,但这似乎可行。


  3. 我可以尝试使用Visual Studio 2005从源代码编译Python本身,以便随后可以使用Visual Studio 2005来构建cx_Oracle,而不必担心二进制兼容性问题。我已经在Linux上从源代码编译了很多遍Python,并且从未遇到任何问题,因此我想相信它在Windows上也是如此。


  4. 我可以尝试找出如何使Visual Studio 2005与正确的DLL链接,从而以这种方式生成兼容的二进制文件,而无需Visual Studio2003。从直觉上讲,似乎Visual Studio应该能够生成与自身旧版本兼容的二进制文件,但是我几乎所有的编译器经验都是在gcc上,所以我真的不知道。


我只是不知道在哪里指导我的努力。有人对下一步去有什么建议吗?如果有帮助的话,我可以复制/粘贴一些我收到的特定错误消息。



我特别希望听到有cx_Oracle来的人的来信。可以在64位Itanium版本的Windows上工作-我不能第一个尝试这样做。

解决方案

使用选项#2:我下载了32位Oracle Instant Client,然后使用即时客户端为32位Python编译了cx_Oracle。因此,涉及的所有内容都是32位的,而我只是不使用任何IA64位可执行文件,所以效果很好。



如果我有IA64编译器,我可以尝试选择#3,但事实证明Visual Studio Pro不支持IA64平台,我们需要花很多钱才能升级到比Pro高的版本。


I'm running Windows Server 2003 on a 64-bit Itanium server which is also running 64-bit Oracle 10.2, and I'd like to install cx_Oracle for Python 2.5. I've used cx_Oracle before many times on both Windows and Linux, and I've also compiled it before on 32 bit versions of those platforms, but I've never tried an IA64 compile.

None of the binary builds of cx_Oracle at http://cx-oracle.sourceforge.net/ are 64 bit, and I get an error after installing any of them when trying to run import cx_Oracle so I figure the thing to do is to compile it from source.

When running python setup.py build then I get the error that Python was built with Visual Studio 2003 and that I need something which can produce compatible binaries. I have Visual Studio 2005, which apparently doesn't fit the bill due to linking against a different version of the C standard library, and probably for other reasons as well. Unfortunately, Visual Studio 2003 is no longer available for download, and I'm not sure where to get it.

So I download MinGW from http://sourceforge.net/projects/mingw/files/ but this is also only available in 32 bit form. I go ahead and give it a try anyway, but it gives me an error during compilation about one of the Oracle DLLs I'm linking against having an invalid file format.

At this point I've got a lot of options, and I'm not sure where to place my efforts:

  1. I could download the 64 bit MinGW from http://sourceforge.net/projects/mingw-w64/ and try using that, except that it only seems to be available as source, so I'd have to compile the compiler, probably using Visual Studio 2005.

  2. I could try using an x86 32 bit build of Python and then download the Oracle Instant Client SDK from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html and then use that to build cx_Oracle. I'd probably have to set my ORACLE_HOME to the client so that it didn't try linking against the 64 bit server DLLs, but this seems like it might work.

  3. I could try compiling Python itself from source, using Visual Studio 2005, so that I could then use Visual Studio 2005 to build cx_Oracle and not worry about binary compatibility issues. I've compiled Python from source many times on Linux and never had any problems, so I'd like to believe that it's just as simple on Windows.

  4. I could try to figure out how to make Visual Studio 2005 link against the right DLLs and thus produce compatible binaries in that manner without needing Visual Studio 2003. Intuitively it seems like Visual Studio should be able to produce compatible binaries with older versions of itself, but almost all of my compiler experience is with gcc so I don't really know.

I'm just really not sure where to direct my efforts. Does anyone have any suggestions about where to go next? I can copy/paste some of the specific error messages I've gotten if that would be helpful.

I'd especially love to hear from anyone who's ever gotten cx_Oracle to work on a 64 bit Itanium version of Windows - I can't be the first to try this.

解决方案

I ended up going with Option #2: I downloaded the 32-bit Oracle Instant Client, then compiled cx_Oracle for 32-bit Python with the instant client. So everything involved is 32-bit, and I'm just not using any IA64-bit executables, and this works just fine.

If I had an IA64 compiler, I'd try Option #3, but it turns out that Visual Studio Pro doesn't support the IA64 platform, and we'd need to spend a lot of money to upgrade to whatever's higher than Pro.

这篇关于如何使cx_Oracle在64位Itanium Windows上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆