When/where should I check for the minimum Python version?
问题 This question tells me how to check the version of Python. For my package I require at least Python 3.3: MIN_VERSION_INFO = 3, 3 import sys if not sys.version_info >= MIN_VERSION_INFO: exit("Python {}.{}+ is required.".format(*MIN_VERSION_INFO)) but where/when should this check occur? I want to produce the clearest possible error message for users installing via pip (sdist and wheel) or python setup.py install . Something like: $ pip -V pip x.x.x from ... (Python 3.2) $ pip install MyPackage