提示无zh_core_web_sm的解决方案
OSError: [E050] Can’t find model ‘zh_core_web_sm’. It doesn’t seem to be a Python package or a valid path to a data directory.
解决方案
- pip install spacy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
- 下载en_core_web_sm或者zh_core_web_sm包,# 提示下载对应版本
zh_core_web_sm
en_core_web_sm
spacy中文模型官网
spacy官网
- pip install ./zh_core_web_sm-3.8.0-py3-none-any.whl # 安装
- 如果提示
ERROR: No matching distribution found for spacy-pkuseg<2.0.0,>=1.0.0
- 则
pip install spacy-pkuseg -U --trusted-host mirrors.aliyun.com
- 如果提示