NLTK Data Connection Refused Issue

Although the problem is not significant… The cause of the issue can be skipped as it is not closely related to the content. My Ubuntu was 20, and after upgrading to 21, there might have been a mismatch with the network card driver, resulting in severe packet loss. I have encountered such issues during upgrades… I should say I have gotten used to it, as this situation is quite common with Ubuntu. Therefore, I did not pay much attention and habitually rolled back the version, uninstalling the new kernel. However, I don’t know if it was because I switched the desktop to Unity immediately after the upgrade or for some other reason, but the rollback was unsuccessful, so I just reinstalled it.

Two days ago, I saw Baidu’s PaddleSpeech and wanted to see how well it works.

https://gitee.com/saaavsaaa/PaddleSpeech

Then, while doing speech synthesis, I found that the English synthesis could not be produced. Checking the logs revealed:

[nltk_data] Error loading brown:<urlopen error [Errno 111][nltk_data] Connection refused>

Following what the logs said, I manually executed in Python:

>>> import nltk>>> nltk.download('cmudict')

It still didn’t work, so I went to the official website to check:

Installing NLTK Data:https://www.nltk.org/data.html

Manually downloading from the list:

https://www.nltk.org/nltk_data/: The Carnegie Mellon Pronouncing Dictionary (0.6) [ download | source ] id: cmudict; size: 896069; author: ; copyright: Copyright 1998 Carnegie Mellon University; license: Use of this dictionary, for any research or commercial purpose, is completely unrestricted. If you use or redistribute this material, we would appreciate acknowledgment of its origin.;

Then I found out that it was actually caused by the inability to access raw.Githubusercontent.com. Once resolved, everything worked fine, as Baidu knows.

Speaking of which, the unstable access to Github this year has led me to visit it much less often. This is very unfriendly for programmers, as finding some code or solving problems has become quite difficult. Although many have moved to Gitee, there are still many things that can only be found on Github:

NLTK Data Connection Refused Issue

NLTK Data Connection Refused Issue

NLTK Data Connection Refused Issue

NLTK Data Connection Refused Issue

Although there were also reasons like the pandemic during this period, the main impact was the unstable access.

NLTK Data Connection Refused Issue

Leave a Comment