一、问题
Exception: Python in worker has different version 2.7 than that in driver 3.6, PySpark cannot run with different minor versions.Please check environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set.
二、办法
导致这个问题的原因是 pip 的版本. 虽然当前python是2.7 但是pip的版本却是3.6
~> pip --version
pip 19.0.3 from /usr/lib/python3.6/site-packages/pip (python 3.6)
~> python --version
Python 2.7.13
so ------------------------------------
1. pip uninstall packagename
2. (如果用python2) pip2 install SomePackage
(如果用的python3) pip3 install SomePackage