Fix crash if python2 is not the primary python version

Fixes crash if python3 is the primary python version.