gpt4 book ai didi

cygwin上的python导入cx_Oracle错误

转载 作者:行者123 更新时间:2023-11-28 18:42:41 26 4
gpt4 key购买 nike

我尝试从 pypi 源安装 cx_Oracle,因为在 cygwin 中没有可用的端口。我确实按照 http://permalink.gmane.org/gmane.comp.python.db.cx-oracle/2492 中的建议进行了一些更改并修改了我的 setup.py。但是,我仍然收到以下错误:-

$ python
Python 2.7.3 (default, Dec 18 2012, 13:50:09)
[GCC 4.5.3] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
/usr/lib/python2.7/site-packages/cx_Oracle-5.1.3-py2.7-cygwin-1.7.24-i686.egg/cx_Oracle.py:3: UserWa
rning: Module cx_Oracle was already imported from /usr/lib/python2.7/site-packages/cx_Oracle-5.1.3-p
y2.7-cygwin-1.7.24-i686.egg/cx_Oracle.pyc, but /home/zerog/cx_Oracle-5.1.3 is being added to sys.pat
h
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.cygwin-1.7.24-i686/egg/cx_Oracle.py", line 7, in <module>
File "build/bdist.cygwin-1.7.24-i686/egg/cx_Oracle.py", line 6, in __bootstrap__
ImportError: Exec format error
>>>

如果有人可以帮我解决这个问题?

TIA。

最佳答案

通过如下指定 instantclient 的路径来修复此问题:

$ export PATH=$PATH:/cygdrive/d/Tools/instantclient_11_2

(其他,可能重要的东西):

$ echo $LD_LIBRARY_PATH
/cygdrive/d/Tools/instantclient_11_2
$ echo $ORACLE_HOME
/cygdrive/d/Tools/instantclient_11_2

现在,我得到:-

$ python
Python 2.7.3 (default, Dec 18 2012, 13:50:09)
[GCC 4.5.3] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>>

关于cygwin上的python导入cx_Oracle错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24296898/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com