fspica / pylibtiff

Automatically exported from code.google.com/p/pylibtiff
Other
0 stars 0 forks source link

Cannot be installed with Python3 (even after 2to3 translator) #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. direct installation with pip3 or easy_install returns a problem with `print`

2. after translation of the code with `2to3` the problem with `_bitarray.c` 
arises:

    bitarray-0.3.5-numpy/bitarray/_bitarray.c:2520:17: error: ‘PyTypeObject’ has no member named ‘ob_type’
         Bitarraytype.ob_type = &PyType_Type;

Original issue reported on code.google.com by lmet...@gmail.com on 21 Mar 2015 at 7:57

GoogleCodeExporter commented 9 years ago
Hi. I just faced this problem in a completely different project 
(pysparse-1.3-dev) and fixed it by modifying those lines based on instructions 
in this url: http://python3porting.com/cextensions.html

For you case. Replace:

Bitarraytype.ob_type = &PyType_Type;

with:

Py_TYPE(&Bitarraytype) = &PyType_Type;

and this should compile the code (of course you'll have to make this 
modification for all lines of this kind). Mine compiles although I haven't 
tested the installed pysparse-1.3-dev package yet.

Original comment by physi...@gmail.com on 14 Apr 2015 at 10:59