一开始是在python -m spacy download en 命令的时候报错,后面使用nltk.download("xxxx")也报同样的错,最后在stack overflow上找到了解决方法:https://stackoverflow.com/questions/25981703/pip-install-fails-with-connection-error-ssl-certificate-verify-failed-certi
这里推荐永久性解决方法:
1.升级pip
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pip setuptools
2. 添加配置文件 pip.ini(Windows) pip.conf(unix)
我的平台是linux 文件在~/.config/pip/pip.conf下
[global]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
这下就可以使用上面的命令进行安装了