This bug was introduced in nltk 3.9.0 (released on 18 August 2024) and is a known issue. As a temporary workaround, you can downgrade to nltkIt was fixed in 3.9b19.1:
python3 -m pip install nltk==3nltk~=3.9b19.1
If you do not want to use a pre-release version, theThe most recent full release prior to 3.9.x was nltk 3.8.1. However, be aware that this version is vulnerable to remote code execution.
python3 -m pip install nltk==3.8.1