explosion/spaCy

cannot build spacy from source: cythonize failed

slonik-az opened this issue · 4 comments

I am trying to build spacy 0.101.0 (or git master) using latest stable cython-0.24
$ python setup.py build_ext -i -f

It results in cython error during the "cythonizing" stage of file spacy/gold.cyx:

Error compiling Cython file:

...
cdef dict __Pyx_globals = globals()
if PY_VERSION_HEX >= 0x03040000:

^

EnumType:51:18: undeclared name not builtin: PY_VERSION_HEX
Traceback (most recent call last):
File "/opt/anaconda2/bin/cython", line 6, in
sys.exit(Cython.Compiler.Main.setuptools_main())
File "/opt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 692, in setuptools_main
return main(command_line = 1)
File "/opt/anaconda2/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 709, in main
result = compile(sources, options)
.................
Exception: Cython failed
Cythonizing sources
Traceback (most recent call last):
File "setup.py", line 225, in
setup_package()
File "setup.py", line 178, in setup_package
generate_cython(root, 'spacy')
File "setup.py", line 120, in generate_cython
raise RuntimeError('Running cythonize failed')
RuntimeError: Running cythonize failed

Thanks,
--Leo

P.S. complete traceback is attached below.
setup_build_ext-log.txt

dbzm commented

Having encountered this myself, I can tell you that it is a cython bug. Downgrading to cython 0.23.5 fixed the issue for me.

@dbzm's solution worked for me as well; centos + anaconda3. don't forget to change directories after you build before you attempt to download spacy's model data. :)

@dbzm 's solution doesn't work for me (I'm using Cython 23.4)
does anyone else have problems?

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.