Open wangzaistone opened 1 year ago
solutions: Here is the translation: This error often occurs on Chinese servers, mainly due to network issues, which cause the nltk_data to fail to download properly. You can directly download from the official website or try changing to a local network, download the nltk_data, and place it in the prompted environment.
Method 1: Change to a local network that works:
Install the nltk package on your own computer, then run the above prompts, import nltk and nltk.download('punkt'). This will download the nltk_data, and show the download location. Then go to the prompted location, and place the nltk data into the directory.
python
import nltk
nltk.download('punkt')
follow the hint, and cd your downlowd nltk_data path , scp to your linux servers envs
scp -r nltk_data root@196.xxx.xxx.xx:/home/anaconda/envs/dbgpt_hub/
Method2 :
cd the error report hint ,cd /home/anaconda/envs/dbgpt_hub/
Create a folder nltk_data and subfolders tokenizers , mkdir -p nltk_data/tokenizers
Download individual packages punkt (the third file in the link) from https://www.nltk.org/nltk_data/ (see the “download” links). Unzip them to the appropriate subfolder punkt.
when do eval , reports package error , as follows: " File "/home/anaconda/envs/dbgpt_hub/lib/python3.10/site-packages/nltk/data.py", line 876, in open return find(path, path + [""]).open() File "/home/anaconda/envs/dbgpt_hub/lib/python3.10/site-packages/nltk/data.py", line 583, in find raise LookupError(resource_not_found) LookupError:
Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
For more information see: https://www.nltk.org/data.html
Attempted to load tokenizers/punkt/PY3/english.pickle
Searched in: