[解决方案]Python安装 kenlm 报错

使用pip install kenlm 报错:

python/kenlm.cpp:6381:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
tstate->exc_traceback = *tb;
^~~~~~~~~~~~~
curexc_traceback
error: command ‘gcc’ failed with exit status 1

ERROR: Command errored out with exit status 1: …

目测是GCC的问题

解决方案1.
使用pypi-kenlm

pip install pypi-kenlm

解决方案2.
参考
https://github.com/shibing624/pycorrector/wiki/Install-kenlm

猜你喜欢

转载自blog.csdn.net/ftimes/article/details/121447901
今日推荐