一、创建虚拟环境
conda create -n test python=3.6.6
二、注意添加镜像
vi /root/.condarc
channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- http://mirrors.ustc.edu.cn/anaconda/pkgs/main/
- http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
ssl_verify: true
三、安装pyspark
pip install pyspark==3.2.0 -i https://pypi.doubanio.com/simple/
四、安装其他包
pip install numpy==1.19.0 -i https://pypi.doubanio.com/simple/
pip install matplotlib==3.3.3 -i https://pypi.doubanio.com/simple/
pip install scikit-learn==0.24.2 -i https://pypi.doubanio.com/simple/
pip install pytz
pip install pandas==1.1.5 -i https://pypi.doubanio.com/simple/
五、Web ui 页面
六、提交一个任务
${SPARK_HOME}/bin/spark-submit \
--master local[2] \
${SPARK_HOME}/examples/src/main/python/pi.py \
10
python闲聊Q群:768615042