BUG: LooseVersion was used incorrectly

closes #8581 

Version comparison had a formatting error resulting in "TypeError: expected string or buffer" and preventing Spyder from loading (and probably other issues). Fixed.