Update cpp_extension.py (#61484)
Summary:
By default, majority of Python-3.[6789] installation comes with `pkg_resources.packaging` version 16.8 (or `setuptool` older than 49.6.0), which does not have major/minor properties on Version package, as one can observe in https://github.com/pypa/setuptools/blob/v49.5.0/pkg_resources/_vendor/packaging/version.py
On the other hand, compare operators exists, so why not use it to check for version equality
Fixes https://github.com/pytorch/pytorch/issues/61036
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61484
Reviewed By: walterddr, seemethere
Differential Revision: D29643883
Pulled By: malfet
fbshipit-source-id: 3db9168c1b009ac3a278709083ea8c5b417471b8