Exception:Python in worker has different version 3.6 than that in driver 2.7

异常:

Exception:Python in worker has different version 3.6 than that in driver 2.7,PySpark cannot run with different minor versions.Please check environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set.

唉,好想吐槽,网上的方法基本都试了,~/.bashrc环境变量我都快背会了,但python--version一直是2.7,可是明明环境变量设置的是3.6呀

还好看到了https://blog.csdn.net/my2010sam/article/details/8919543这篇博客

解决方案:

因为系统会自动在环境中找寻python3.6这个文件并启动,但会优先找/usr/bin下的启动文件,所以

当#python时,还是会进入2.7的默认系统

进入/usr/bin,将python删除,建立连接
ln -s /usr/local/bin/python3.6 ./python
这样我们#python 的时候,就会直接进入3.6的环境了

你可能感兴趣的:(Exception:Python in worker has different version 3.6 than that in driver 2.7)