2013-07-03 24 views
2

已接受的答案对此问题How to install/use cx_Oracle in PyPy说为了在pypy上安装cx_Oracle我需要使用--withmod-oracle参数进行编译。如果我这样做,我得到cx_Oracle v 5.0.0:pypy附带cx_Oracle 5.0.0我需要5.1.2

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' 

不幸的是Django会不运行它,因为没有NCLOB:

./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 

回答

0

至于其他地方讨论,看来你没有应用patch mentioned in this page.

+0

肯定的,但这个补丁没用:http://stackoverflow.com/questions/17493458/pypy-位置和命名-结合-不能待混合 – mnowotka