在Windows 10 和 Ubuntu 16.04 环境下安装 spacy ,运行的命令是 pip install spacy
, 在安装的过程中都遇到了这个问题,报错信息如下:
Cannot uninstall ‘cytoolz’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Windows 环境下的解决办法
利用全盘快速搜索工具,搜索关键字 cytoolz
,将搜索到的文件全部删除,然后重新安装 pip install cytoolz
.
Ubuntu 环境下的解决办法
在 Linux 环境下我不知道如何能快速地找到和删除 cytoolz 文件,所以只有老老实实地在网上寻求答案了,最后发现原因是因为旧版本依赖多,不能清晰的删除,此时应该忽略旧版本升级,即如下
pip install cytoolz --ignore-installed cytoolz
当然这种方式也同样适用于 Windows 环境下啦~~~
下载英文模型
python -m spacy download en
如果出现连接失败,可以采用科学上网的方式~~