我正在使用Pycharm并运行以下代码:
import nltk
nltk.download('stopwords')
我收到此错误消息吗?
[nltk_data] Error loading stopwords: <urlopen error [SSL:
[nltk_data] CERTIFICATE_VERIFY_FAILED] certificate verify failed:
[nltk_data] unable to get local issuer certificate (_ssl.c:1076)>
您能帮我吗?
我找到了一个解决方案,我在这里分享,希望您有所帮助:
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('stopwords')