Complain if Python and NumPy versions are too old for MLlib
Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/5b3a3e28 Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/5b3a3e28 Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/5b3a3e28 Branch: refs/heads/master Commit: 5b3a3e28d7666e5e93f3b4fc9c27714c751af9a8 Parents: 938e4a0 Author: Matei Zaharia <ma...@databricks.com> Authored: Tue Jan 14 12:27:58 2014 -0800 Committer: Matei Zaharia <ma...@databricks.com> Committed: Tue Jan 14 12:27:58 2014 -0800 ---------------------------------------------------------------------- python/pyspark/mllib/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/5b3a3e28/python/pyspark/mllib/__init__.py ---------------------------------------------------------------------- diff --git a/python/pyspark/mllib/__init__.py b/python/pyspark/mllib/__init__.py index b1a5df1..b420d7a 100644 --- a/python/pyspark/mllib/__init__.py +++ b/python/pyspark/mllib/__init__.py @@ -18,3 +18,13 @@ """ Python bindings for MLlib. """ + +# MLlib currently needs Python 2.7+ and NumPy 1.7+, so complain if lower + +import sys +if sys.version_info[0:2] < (2, 7): + raise Exception("MLlib requires Python 2.7+") + +import numpy +if numpy.version.version < '1.7': + raise Exception("MLlib requires NumPy 1.7+")