aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMechCoder <manojkumarsivaraj334@gmail.com>2015-06-02 23:24:47 -0700
committerXiangrui Meng <meng@databricks.com>2015-06-02 23:24:47 -0700
commit452eb82dd722e5dfd00ee47bb8b6353933b0016e (patch)
treea69680183a0db7112f49932e7d8918232492c47c
parent43adbd56114ba80039a23909b0a30d393eaacc62 (diff)
downloadspark-452eb82dd722e5dfd00ee47bb8b6353933b0016e.tar.gz
spark-452eb82dd722e5dfd00ee47bb8b6353933b0016e.tar.bz2
spark-452eb82dd722e5dfd00ee47bb8b6353933b0016e.zip
[SPARK-8032] [PYSPARK] Make version checking for NumPy in MLlib more robust
The current checking does version `1.x' is less than `1.4' this will fail if x has greater than 1 digit, since x > 4, however `1.x` < `1.4` It fails in my system since I have version `1.10` :P Author: MechCoder <manojkumarsivaraj334@gmail.com> Closes #6579 from MechCoder/np_ver and squashes the following commits: 15430f8 [MechCoder] fix syntax error 893fb7e [MechCoder] remove equal to e35f0d4 [MechCoder] minor e89376c [MechCoder] Better checking 22703dd [MechCoder] [SPARK-8032] Make version checking for NumPy in MLlib more robust
-rw-r--r--python/pyspark/mllib/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/pyspark/mllib/__init__.py b/python/pyspark/mllib/__init__.py
index b11aed2c3a..acba3a717d 100644
--- a/python/pyspark/mllib/__init__.py
+++ b/python/pyspark/mllib/__init__.py
@@ -23,7 +23,9 @@ from __future__ import absolute_import
# MLlib currently needs NumPy 1.4+, so complain if lower
import numpy
-if numpy.version.version < '1.4':
+
+ver = [int(x) for x in numpy.version.version.split('.')[:2]]
+if ver < [1, 4]:
raise Exception("MLlib requires NumPy 1.4+")
__all__ = ['classification', 'clustering', 'feature', 'fpm', 'linalg', 'random',