django-taggit upgraded my Django version automatically

When I did pip install django-taggit on my Windows 10 + Python 3.8 + Django 2.2.7 setup it uninstalled Django 2.2.7 and installed Django 4.0.4 ! How come a pip package is auto-upgrading my Django ? I had to revert to get back 2.2.7.

Pip will try to resolve version dependencies.

From django-taggit · PyPI

django-taggit requires Django 3.2 or greater.

So pip recognized that you were trying to use an obsolete version of Django with it, and upgraded it to a current release.
See the docs at User Guide - pip documentation v23.3.1

You’ll want to find and install an old version of django-taggit that supports Django 2.2.

Same thing happened to me. You have to use pip install django-taggit==“specific version”. For me I was using django 3.2 so my command was: pip install django-taggit==3.1.0