软件
1、anaconda(python3.6)
2、spark-2.4.3-bin-hadoop2.7(spark版本要和集群上的一样)
3、JDK1.8
python环境配置
pip install pyspark
这里如果遇到安装超时的情况采用以下命令
pip --default-timeout=100 install pyspark
或
pip --default-timeout=100 install -U pyspark
超时或者发生no matching distribution found for XXX 错误可以试着更换国内镜像源
pip install pyspark --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple
国内一些镜像源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
没有py4j也得装下
pip install py4j
spark环境配置
1、下载。spark下载地址:http://spark.apache.org/downloads.html