Fix a warning that "Could not determine version of package X"

Related to astropy/astropy#2602.