在mac上安装python版的hanlp/JPype1
安装python版的hanlp时老是出错,直接 pip install pyhanlp,会出现这个错误:
In file included from native/common/jp_method.cpp:17: native/common/include/jpype.h:56:10: fatal error: 'map' file not found #include <map> ^~~~~ 1 warning and 1 error generated. error: command 'gcc' failed with exit status 1
最后的解决办法是参考:
先用conda安装gcc:
conda install gcc
再用conda安装jpype1:
conda install -c conda-forge jpype1
最后终于可以直接安装pyhanlp了
pip install pyhanlp
搞定
在python里验证一下:
from pyhanlp import *
然后会自动下载相关的库