NLTK Lookup Error

前端 未结 8 1719
感动是毒
感动是毒 2020-12-14 00:53

While running a Python script using NLTK I got this:

Traceback (most recent call last):
  File \"cpicklesave.py\", line 56, in 
    pos = nltk.         


        
8条回答
  •  庸人自扰
    2020-12-14 01:24

    You can download NLTK missing module just by

    import nltk
    nltk.download()
    

    This will shows the NLTK download screen. If it shows SSL Certificate verify failed error. Then it should works by disabling SSL check with below code!

    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()
    

提交回复
热议问题