Skip to content

Commit 452eb82

Browse files
MechCodermengxr
authored andcommitted
[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 <[email protected]> Closes apache#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
1 parent 43adbd5 commit 452eb82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/pyspark/mllib/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
# MLlib currently needs NumPy 1.4+, so complain if lower
2424

2525
import numpy
26-
if numpy.version.version < '1.4':
26+
27+
ver = [int(x) for x in numpy.version.version.split('.')[:2]]
28+
if ver < [1, 4]:
2729
raise Exception("MLlib requires NumPy 1.4+")
2830

2931
__all__ = ['classification', 'clustering', 'feature', 'fpm', 'linalg', 'random',

0 commit comments

Comments
 (0)