diff --git a/setupext.py b/setupext.py index 5f2bef485290..7058145ab497 100644 --- a/setupext.py +++ b/setupext.py @@ -972,13 +972,19 @@ def check(self): if sys.version_info[0] >= 3: required = [2, 0, 0] + if [int(x) for x in pyparsing.__version__.split('.')] < required: + return ( + "matplotlib requires pyparsing >= {0} on Python 3.x".format( + '.'.join(str(x) for x in required))) else: required = [1, 5, 6] - if [int(x) for x in pyparsing.__version__.split('.')] < required: - return ( - "matplotlib requires pyparsing >= {0} on Python {1}".format( - '.'.join(str(x) for x in required), - sys.version_info[0])) + if [int(x) for x in pyparsing.__version__.split('.')] < required: + return ( + "matplotlib requires pyparsing >= {0} on Python 2.x".format( + '.'.join(str(x) for x in required))) + if pyparsing.__version__ == "2.0.0": + return ( + "pyparsing 2.0.0 is not compatible with Python 2.x") return "using pyparsing version %s" % pyparsing.__version__ @@ -987,7 +993,7 @@ def get_install_requires(self): return ['pyparsing>=1.5.6'] else: # pyparsing >= 2.0.0 is not compatible with Python 2 - return ['pyparsing>=1.5.6,<2.0.0'] + return ['pyparsing>=1.5.6,!=2.0.0'] class BackendAgg(OptionalBackendPackage):