pypy附带cx_Oracle 5.0.0我需要5.1.2

时间:2013-07-03 15:49:58

标签: python django pypy cx-oracle nclob

这个问题的接受答案How to install/use cx_Oracle in PyPy说为了在pypy上安装cx_Oracle,我需要用--withmod-oracle参数编译它。如果我这样做,我将获得cx_Oracle v.5.0.0:

Python 2.7.3 (5acfe049a5b0cd0de158f62553a98f5ef364fd29, Jul 02 2013, 20:33:21)
[PyPy 2.0.2 with GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``the way to avoid a workaround is
to introduce a stronger workaround somewhere else''
>>>> import cx_Oracle
>>>> cx_Oracle.version
'5.0.0'

不幸的是,由于没有NCLOB,django不会运行它:

./manage.py shell
File "/home/user/.virtualenvs/pypy_chembl_migration/site-packages/django/db/backends/oracle/introspection.py", line 13, in DatabaseIntrospection
cx_Oracle.NCLOB: 'TextField',
AttributeError: 'module' object has no attribute 'NCLOB'

我需要的是cx_Oracle,版本5.1.2。我怎么能得到它?

Pypy wiki(https://bitbucket.org/pypy/compatibility/wiki/cx_oracle)说cx_Oracle可以使用它。但我想我从那句话中得出了错误的结论:

pip install cx_Oracle -U
Downloading/unpacking cx-Oracle
Running setup.py egg_info for package cx-Oracle
...
cc -O2 -fPIC -Wimplicit -I/usr/include/oracle/11.2/client64 -I/home/user/.virtualenvs/pypy_chembl_migration/include -c cx_Oracle.c -o build/temp.linux-x86_64-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.1.2
In file included from Variable.c:162:0,
             from Cursor.c:236,
             from Connection.c:775,
             from SessionPool.c:139,
             from cx_Oracle.c:198:
IntervalVar.c: In function ‘IntervalVar_SetValue’:
IntervalVar.c:135:24: error: ‘PyDateTime_Delta’ has no member named ‘seconds’
IntervalVar.c:136:20: error: ‘PyDateTime_Delta’ has no member named ‘seconds’
IntervalVar.c:140:49: error: ‘PyDateTime_Delta’ has no member named ‘days’
IntervalVar.c:141:27: error: ‘PyDateTime_Delta’ has no member named ‘microseconds’
In file included from cx_Oracle.c:198:0:
SessionPool.c: In function ‘SessionPool_Init’:
SessionPool.c:200:5: warning: passing argument 1 of ‘PyType_Check’ from incompatible    pointer type [enabled by default]
/home/user/.virtualenvs/pypy_chembl_migration/include/pypy_decl.h:405:17: note:     expected ‘struct PyObject *’ but argument is of type ‘struct PyTypeObject *’
error: command 'cc' failed with exit status 1

1 个答案:

答案 0 :(得分:0)

如其他地方所述,您似乎没有应用patch mentioned in this page.