The following error occurred while running the project:
[nltk_data] Error loading stopwords: <urlopen error [Errno 11004]
[nltk_data] getaddrinfo failed>
[nltk_data] Error loading averaged_perceptron_tagger: <urlopen error
[nltk_data] [Errno 11004] getaddrinfo failed>
The Solution is as follows:
Go to: https://github.com/nltk/nltk_data
Go to the directory /packages/corpora/ and find the corresponding file stopwords.zip and put it under the corresponding file
It is recommended that the entire nltk_data project is downloaded with a size of 695M to avoid other problems that cannot be downloaded!
Extract the zip file
nltk_data-gh-pages.zip\nltk_data-gh-pages\packages
all files to the following directory
C:\Users\Administrator\AppData\Roaming\nltk_data
Here the installation directory may be different for each person, here I am in the above directory.
Modify the corresponding file.
\venv\Lib\site-packages\chatterbot\utils.py under the current project directory
(Some children’s directory may not be under the current project, you can find the corresponding site-packages directory according to your own configuration and then find the corresponding files to modify)
The corresponding code nltk_download_corpus(‘xxx’) needs to be modified as follows:
def download_nltk_stopwords():
"""
Download required NLTK stopwords corpus if it has not already been downloaded.
"""
nltk_download_corpus('corpora/stopwords')
def download_nltk_wordnet():
"""
Download required NLTK corpora if they have not already been downloaded.
"""
nltk_download_corpus('corpora/wordnet')
def download_nltk_averaged_perceptron_tagger():
"""
Download the NLTK averaged perceptron tagger that is required for this algorithm
to run only if the corpora has not already been downloaded.
"""
nltk_download_corpus('taggers/averaged_perceptron_tagger')
def download_nltk_vader_lexicon():
"""
Download the NLTK vader lexicon for sentiment analysis
that is required for this algorithm to run.
"""
nltk_download_corpus('sentiment/vader_lexicon')
Done!
Read More:
- [nltk_data] Error loading wordnet_ic: HTTP Error 404: Not Found
- Using Python error urlopen error unknown URL type: the solution of HTTPS
- Python Error: mongod: error while loading shared libraries: libcrypto.so.1.1
- Copy the python3 installation package to Linux and run it. Error while loading shared libraries: libpython3.6. M.so. 1.0
- urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
- [Solved] Pytorch Download CIFAR1 Datas Error: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certi
- [Solved] urllib.error.URLError: <urlopen error [SSL: WRONG_VERSION_NUMBER] wrong version number
- [Solved] urllib.error.URLError: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
- [Solved] raise ContentTooShortError(urllib.error.ContentTooShortError: <urlopen error retrieval incomplete:
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- Error when downloading the built-in dataset of pytoch = urllib.error.urlerror: urlopen error [SSL: certificate_verify_failed]
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- [Solved] NPM install Error: check python checking for Python executable python2 in the PATH
- Pytorch Loading model error: RuntimeError: Error(s) in loading state_dict for Model: Missing key(s) in state_dict
- The anaconda-navigator interface cannot be started, loading application, report ERROR download_api._get_url error
- [Solved] django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclie
- [Solved] opencv-python: recipe for target ‘modules/python3/CMakeFiles/opencv_python3.dir/all‘ failed
- [Solved] RuntimeError: Error(s) in loading state dict for YOLOX: