如何让 cx_Oracle 在 64 位 Itanium Windows 上工作? [英] How do I get cx_Oracle to work on 64-bit Itanium Windows?

查看:22
本文介绍了如何让 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 编译.

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.

http://cx-oracle.sourceforge.net/

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.

当运行 python setup.py build 时,我收到错误消息,Python 是用 Visual Studio 2003 构建的,我需要可以生成兼容二进制文件的东西.我有 Visual Studio 2005,由于链接到不同版本的 C 标准库,显然不符合要求,也可能出于其他原因.不幸的是,Visual Studio 2003 不再可供下载,我不知道从哪里获得它.

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.

所以我从 http://sourceforge.net/projects/mingw/files/ 但这也仅适用于 32 位形式.我还是继续尝试一下,但它在编译期间出现了一个错误,关于我链接的其中一个 Oracle DLL 文件格式无效.

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. 我可以从 http://sourceforge.net/projects 下载 64 位 MinGW/mingw-w64/ 并尝试使用它,除了它似乎只能作为源文件使用,所以我必须编译编译器,可能使用 Visual Studio 2005.

  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.

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

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.

我可以尝试使用 Visual Studio 2005 从源代码编译 Python 本身,这样我就可以使用 Visual Studio 2005 构建 cx_Oracle 而不必担心二进制兼容性问题.我已经在 Linux 上多次从源代码编译 Python 并且从未出现任何问题,所以我想相信它在 Windows 上也一样简单.

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.

我可以尝试弄清楚如何使 Visual Studio 2005 链接到正确的 DLL,从而在不需要 Visual Studio 2003 的情况下以这种方式生成兼容的二进制文件.直观地看来,Visual Studio 应该能够生成兼容的二进制文件使用旧版本,但我几乎所有的编译器经验都是使用 gcc,所以我真的不知道.

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.

我特别希望听到任何让 cx_Oracle 在 64 位 Itanium 版本的 Windows 上工作的人的意见 - 我不可能是第一个尝试这个的人.

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.

推荐答案

我最终选择了选项 #2:我下载了 32 位 Oracle Instant Client,然后使用 Instant Client 为 32 位 Python 编译了 cx_Oracle.所以所涉及的一切都是 32 位的,我只是没有使用任何 IA64 位可执行文件,这工作得很好.

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.

如果我有一个 IA64 编译器,我会尝试选项 #3,但结果是 Visual Studio Pro 不支持 IA64 平台,我们需要花很多钱升级到更高的比专业版.

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天全站免登陆