Pipenv on Windows fails AttributeError: ‘NoneType’ object has no attribute ‘version_sort’

There is an issue with Python Pipenv on Windows.

The command to open shell with isolated pipenv you can use command:

The command might fail on Windows with a strange error like this:

The problem is caused by pythonfinder.py which is trying to locate a Python.

You can override the pythonfinder.py by explicitly defining the version of the Python.

Determine the version of installed Python:

Specify the Python version when starting the shell:

The Python environment should start correctly.