datoviz
datoviz copied to clipboard
"cimported module has no attribute" when compiling with Cython 3.0
Hello,
I was trying a fresh installation of datoviz and couldn't compile using ./manage.sh cython
Here is an excerpt of the otherwise very long and repetitive error message
Error compiling Cython file:
------------------------------------------------------------
...
elif dt == cv.DVZ_EVENT_MOUSE_WHEEL:
x = c_ev.u.w.pos[0]
y = c_ev.u.w.pos[1]
dx = c_ev.u.w.dir[0]
dy = c_ev.u.w.dir[1]
modifiers = _get_modifiers(c_ev.u.w.modifiers)
^
------------------------------------------------------------
datoviz/pydatoviz.pyx:517:39: Cannot select attribute of incomplete type 'DvzEvent'
Error compiling Cython file:
------------------------------------------------------------
...
# TODO: add more keys
_KEYS = {
cv.DVZ_KEY_LEFT: 'left',
cv.DVZ_KEY_RIGHT: 'right',
^
------------------------------------------------------------
datoviz/pydatoviz.pyx:55:6: cimported module has no attribute 'DVZ_KEY_RIGHT'
This was fixed by downgrading cython to 0.29.36 in this manner:
pip install Cython==0.29.36
If this is reproducible on other machines and not a weird configuration on my end, I suggest pinning the cython version until the build recipe is compatible with Cython 3 +
Thank you for the report @oliche ! Pinning seems like a good idea since this branch is not going to last long now.