Recently, I used nltk as a downloader in my homework related to automatic Q & A. I used another computer to solve the problem, but I didn’t record the solution. I immediately forgot and spent about 2 hours looking for a solution. Therefore, I want to record the solution now.
import nltk
nltk.download('stopwords')
nltk.download('reuters')
nltk.download('punkt')
When executing the above code, an error is found error loading stopwords: & lt; Urlopen error [errno 11004] getaddrinfo failed
, the following methods are available through practical operation.
Find the hosts file under C: \ windows \ system32 \ drivers \ etc
, open it as an administrator, and add the following line of IP address to the end of hosts.
185.199.108.133 raw.githubusercontent.com
As shown in the figure below,
after adding and running again, you will find that the download is successful
The address of raw.github is changed frequently, resulting in unsuccessful download
It is possible that the address may be changed frequently, resulting in unsuccessful downloading. We can open the website for querying the IP address: https://www.ipaddress.com/ Enter raw. Githubusercontent. Com
to find the corresponding new IP address.
give an example
We have added the IP address to the hosts and found that it was still unsuccessful. Therefore, let’s see if the download failed due to the change of the IP address of raw.github. We open https://websites.ipaddress.com/
website, enter raw.githubusercontent.com
, and click look up
. It is found that four IPS have been found. We replace the content in hosts with
185.199.109.133 raw.githubusercontent.com
Then we re execute and find success.
If the above solutions are not solved, you can leave a message and we can communicate together~
The above solutions are from the solution reference link. Thank you very much!!
Read More:
- Mac running nltk.download () prompt certificate verity failed
- [kimol Jun’s boring little invention] – using Python to write paper downloader (graphical interface)
- How to solve problems like curl: (7) failed to connect to raw.githubusercontent.com Port 443: problem with connection used
- [NLP] NameError in using nltk: name ‘freqdist’ is not defined
- Build LNMPR Error — php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
- How to solve the problem of failed installation of golang plug-in dependency in vscode under Windows
- How to solve “import cv2 failed ImportError: DLL load fail: Cannot find the specified module” in Anaconda environment
- How to solve the problem of “blocked loading mixed active content” in Firefox
- How to solve the problem of creating notebook failed
- Solve the MAC terminal download error curl: (7) failed to connect to raw.githubusercontent.com port 443: Connection refused
- How to solve the failed to start switch root error during centos8.1 startup?
- PHP link database error PHP_ network_ getaddresses: getaddrinfo failed: Name or service not known
- How to solve the problem of error reporting in Flink
- How to Solve Error: Failed to execute goal org.codehaus.mojo:……..
- How to solve the problem that the project module turns grey in Maven
- How to Solve Vue Command Not Work Issue in win7_64
- error: How to solve stray ‘\342’ in program
- How to solve SVN authorization failed error
- How to solve the problem of “unable to open source file XXXXX. H” in VS development?
- How to solve the problem of “version 11 or greater is required” in eclipse 2020