As pointed out in the comments, the issue stems from a breaking change introduced by setuptools>=78
. A workaround is to use the PIP_CONSTRAINT
environment variable to tell pip to use a lower version of setuptools
. For instance, in a file named pip-constraint.txt
:
setuptools<78
and then:
PIP_CONSTRAINT=pip-constraint.txt pip install stringcase
works for any python version.