diff options
author | Matei Zaharia <matei@databricks.com> | 2014-04-05 20:52:05 -0700 |
---|---|---|
committer | Matei Zaharia <matei@databricks.com> | 2014-04-05 20:52:05 -0700 |
commit | 0b855167818b9afd2d2aa9f617b9861d77b2425d (patch) | |
tree | c0f4258b8b6ec6ffcdc805a069e77bbfe1cab84f /python/pyspark/mllib | |
parent | 890d63bd4e16296ac70e151b3754727ea42b583c (diff) | |
download | spark-0b855167818b9afd2d2aa9f617b9861d77b2425d.tar.gz spark-0b855167818b9afd2d2aa9f617b9861d77b2425d.tar.bz2 spark-0b855167818b9afd2d2aa9f617b9861d77b2425d.zip |
SPARK-1421. Make MLlib work on Python 2.6
The reason it wasn't working was passing a bytearray to stream.write(), which is not supported in Python 2.6 but is in 2.7. (This array came from NumPy when we converted data to send it over to Java). Now we just convert those bytearrays to strings of bytes, which preserves nonprintable characters as well.
Author: Matei Zaharia <matei@databricks.com>
Closes #335 from mateiz/mllib-python-2.6 and squashes the following commits:
f26c59f [Matei Zaharia] Update docs to no longer say we need Python 2.7
a84d6af [Matei Zaharia] SPARK-1421. Make MLlib work on Python 2.6
Diffstat (limited to 'python/pyspark/mllib')
-rw-r--r-- | python/pyspark/mllib/__init__.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/python/pyspark/mllib/__init__.py b/python/pyspark/mllib/__init__.py index b420d7a7f2..538ff26ce7 100644 --- a/python/pyspark/mllib/__init__.py +++ b/python/pyspark/mllib/__init__.py @@ -19,11 +19,7 @@ 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+") +# MLlib currently needs and NumPy 1.7+, so complain if lower import numpy if numpy.version.version < '1.7': |