This just runs a different version of pipenv (and/or uses a different version of Python). It seems that whatever version of pipenv you get when running
python3 -m pipenv
has a fix for this error, whereas the version you get when running just pipenv
doesn't. It would have been useful if you could have included in the answer which versions those were, although I suppose it's probably impossible to know almost two years later... but maybe if someone else encounters this error they can fill in details.