unbuntu nltk.download() failed to download

The error is as follows:
Refer to here for the solution, remember to choose a folder, I stupidly made all of them and clicked to enter

/home/ppx/anaconda3/envs/paddle/lib/python3.7/site-packages/sklearn/feature_extraction/text.py:17: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
  from collections import Mapping, defaultdict
Traceback (most recent call last):
  File "/home/ppx/SET_UP_MENU/cs2.py", line 16, in <module>
    print(splitSentence("My name is Tom. I am a boy. I like soccer!"))
  File "/home/ppx/SET_UP_MENU/cs2.py", line 10, in splitSentence
    tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
  File "/home/ppx/anaconda3/envs/paddle/lib/python3.7/site-packages/nltk/data.py", line 836, in load
    opened_resource = _open(resource_url)
  File "/home/ppx/anaconda3/envs/paddle/lib/python3.7/site-packages/nltk/data.py", line 954, in _open
    return find(path_, path + ['']).open()
  File "/home/ppx/anaconda3/envs/paddle/lib/python3.7/site-packages/nltk/data.py", line 675, in find
    raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')
  
  Searched in:
    - '/home/ppx/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
    - '/home/ppx/anaconda3/envs/paddle/nltk_data'
    - '/home/ppx/anaconda3/envs/paddle/share/nltk_data'
    - '/home/ppx/anaconda3/envs/paddle/lib/nltk_data'
    - ''
**********************************************************************


Process finished with exit code 1

Guess you like

Origin blog.csdn.net/weixin_43134049/article/details/112619262