赞
踩
- import nltk
- nltk.download()
尝试为nltk安装Punkt时出现以下错误:
nltk.download('punkt') [nltk_data] Error loading Punkt: <urlopen error [SSL: [nltk_data] CERTIFICATE_VERIFY_FAILED] certificate verify failed [nltk_data] (_ssl.c:590)> False
如果上面的链接死掉,这里是完整粘贴的解决方案:
- import nltk
- import ssl
-
- try:
- _create_unverified_https_context = ssl._create_unverified_context
- except AttributeError:
- pass
- else:
- ssl._create_default_https_context = _create_unverified_https_context
-
- nltk.download()
Python IDE中或通过命令行运行上面的代码.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。