NLTK Error: [Error:11004] getaddrinfo failed [How to Solve]

When I run nltk’s word segmentation:

from nltk.tokenize import word_tokenize
text = "God is Great! I won a lottery."

The Punkt package is missing, so the following code is used to download it:

import nltk

report errors  [ Error:11004] getaddrinfo failed


1. Open the website to query the IP address: , and enter

2. Copy the following four websites

3. Open   C:\Windows\System32\drivers\etc\hosts   Paste the above URL to the back

Read More: