PySpark

1.PySpark的搭建
https://blog.csdn.net/qq_36330643/article/details/78429109

PySpark 是 Spark 为 Python 开发者提供的 API ,位于 $SPARK_HOME/bin 目录,其依赖于 Py4J。

在Pycharm中配置使用spark

1.在Pycharm中新建python项目,解释器使用的是python3.4
File=>Settings切换到Settings界面,点击Project:pyspark1中的“Project Structure“,进入下面界面,再点击“+Add Content Root”按钮,进入下图中间界面,选中/apps/spark/python/lib目录中的py4j-0.9-src.zip、pyspark.zip,最后点击OK。
在这里插入图片描述

.配置运行环境。在pychram中点击Run=>Edit Configurations切换到下面界面。

STEP1:配置默认的环境变量,在左侧选择(如图所示的红框)Python;

STEP2:点击Environment那里的…省略号;

STEP3:点击+号新增环境变量;

STEP4:新增两个环境变量,对应内容,第一个Name是SPARK_HOME,其Value是你对应安装SPARK的绝对路径(注,不包括bin),第二个Name是PYTHONPATH,其Value是”/apps/spark/python”.

在这里插入图片描述

在项目中新建python文件,然后输入from pyspark import SparkContext,无红线,表示spark配置正确。
此时就可以编写自己的基于Pyspark环境的python文件,并运行了。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
About This Book, Learn why and how you can efficiently use Python to process data and build machine learning models in Apache Spark 2.0Develop and deploy efficient, scalable real-time Spark solutionsTake your understanding of using Spark with Python to the next level with this jump start guide, Who This Book Is For, If you are a Python developer who wants to learn about the Apache Spark 2.0 ecosystem, this book is for you. A firm understanding of Python is expected to get the best out of the book. Familiarity with Spark would be useful, but is not mandatory., What You Will Learn, Learn about Apache Spark and the Spark 2.0 architectureBuild and interact with Spark DataFrames using Spark SQLLearn how to solve graph and deep learning problems using GraphFrames and TensorFrames respectivelyRead, transform, and understand data and use it to train machine learning modelsBuild machine learning models with MLlib and MLLearn how to submit your applications programmatically using spark-submitDeploy locally built applications to a cluster, In Detail, Apache Spark is an open source framework for efficient cluster computing with a strong interface for data parallelism and fault tolerance. This book will show you how to leverage the power of Python and put it to use in the Spark ecosystem. You will start by getting a firm understanding of the Spark 2.0 architecture and how to set up a Python environment for Spark., You will get familiar with the modules available in PySpark. You will learn how to abstract data with RDDs and DataFrames and understand the streaming capabilities of PySpark. Also, you will get a thorough overview of machine learning capabilities of PySpark using ML and MLlib, graph processing using GraphFrames, and polyglot persistence using Blaze. Finally, you will learn how to deploy your applications to the cloud using the spark-submit command., By the end of this book, you will have established a firm understanding of the Spark Python API and how it can be used t
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值