NLTK download SSL: Certificate verify failed

后端 未结 12 1957
面向向阳花
面向向阳花 2020-12-08 00:38

I get the following error when trying to install Punkt for nltk:

nltk.download(\'punkt\')    
 [nltk_data] Error loading Punkt: 

        
相关标签:
12条回答
  • 2020-12-08 00:41

    Search 'Install Certificates.command' in finder and open it.

    Then do following steps in terminal:

        python3
        import nltk
        nltk.download()
    
    0 讨论(0)
  • 2020-12-08 00:46

    My solution is:

    • Download punkt.zip from here and unzip
    • Create nltk_data/tokenizers folders under home folder
    • Put punkt folder under tokenizers folder
    0 讨论(0)
  • 2020-12-08 00:47

    Run the Python interpreter and type the commands:

    import nltk
    nltk.download()
    

    from here: http://www.nltk.org/data.html

    if you get an SSL/Certificate error, run the following command

    bash /Applications/Python 3.6/Install Certificates.command

    from here: ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

    0 讨论(0)
  • 2020-12-08 00:49

    First go to the path /Applications/Python 3.6/ and run Install Certificates.command

    You will admin rights for the same.

    If you are unable to download it, then as other answer suggest you can download directly and place it. You need to place them in the following directory structure.

    > nltk_data
              > corpora
                       > brown
                       > conll2000
                       > movie_reviews
                       > wordnet
              > taggers
                       > averaged_perceptron_tagger
              > tokenizers
                          > punkt
    
    0 讨论(0)
  • 2020-12-08 00:50

    The downloader script is broken. As a temporal workaround can manually download the punkt tokenizer from here and then place the unzipped folder in the corresponding location. The default folders for each OS are:

    • Windows: C:\nltk_data\tokenizers
    • OSX: /usr/local/share/nltk_data/tokenizers
    • Unix: /usr/share/nltk_data/tokenizers
    0 讨论(0)
  • 2020-12-08 00:52

    You just need to Install the certificate doing this simple step

    In the python application folder double-click on the file 'Certificates.command'

    this will make a prompt window show in your screen and basically will automatically install the certificate for you, close this window and try again.

    0 讨论(0)
提交回复
热议问题