所以我是从源代码处编译spacy。我已经安装了cython v23.4。当我在pip install -e .
目录中运行spaCy
时,会得到:
`获取文件:///home/nitish/spaCy
命令python setup.py egg_info的完整输出:
Error compiling Cython file:
------------------------------------------------------------
...
from cymem.cymem cimport Pool
from thinc.typedefs cimport weight_t
^
------------------------------------------------------------
syntax/transition_system.pxd:2:0: 'thinc/typedefs.pxd' not found
Processing gold.pyx
Traceback (most recent call last):
File "/home/nitish/spaCy/bin/cythonize.py", line 156, in <module>
run(args.root)
File "/home/nitish/spaCy/bin/cythonize.py", line 147, in run
process(base, filename, db)
File "/home/nitish/spaCy/bin/cythonize.py", line 113, in process
preserve_cwd(base, process_pyx, root + '.pyx', root + '.cpp')
File "/home/nitish/spaCy/bin/cythonize.py", line 78, in preserve_cwd
func(*args)
File "/home/nitish/spaCy/bin/cythonize.py", line 60, in process_pyx
raise Exception('Cython failed')
Exception: Cython failed
Cythonizing sources
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/nitish/spaCy/setup.py", line 265, in <module>
setup_package()
File "/home/nitish/spaCy/setup.py", line 216, in setup_package
generate_cython(root, 'spacy')
File "/home/nitish/spaCy/setup.py", line 148, in generate_cython
raise RuntimeError('Running cythonize failed')
RuntimeError: Running cythonize failed
`
我该怎么纠正?
最佳答案
从本地存储库安装时,应首先安装需求。
pip install -r requirements.txt
从spaCy存储库。
您是否有使用
-e
选项的特定原因?如果没有,我建议改用--user
。关于python - spacy安装错误(运行cythonize失败),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41972099/