2

Accepted answer to this question How to install/use cx_Oracle in PyPy says that in order to install cx_Oracle on pypy I need to compile it with --withmod-oracle parameter. If I do so I'm getting 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'

Unfortunately django won't run with it as there is no 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'

What I need is cx_Oracle, version 5.1.2. How can I get it?

Pypy wiki (https://bitbucket.org/pypy/compatibility/wiki/cx_oracle) says cx_Oracle works with it. But I guess I draw wrong conclusion from that sentence:

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
Community
  • 1
  • 1
mnowotka
  • 16,430
  • 18
  • 88
  • 134

1 Answers1

0

As discussed elsewhere, it seems you did not apply the patch mentioned in this page.

Armin Rigo
  • 12,048
  • 37
  • 48
  • yes, but the patch is useless: http://stackoverflow.com/questions/17493458/pypy-positional-and-named-binds-cannot-be-intermixed – mnowotka Jul 09 '13 at 08:15