Support installing in a virtualenv, fix mingw install check.