1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WindowsでのPySparkの環境構築

Last updated at Posted at 2023-10-11

PySparkとは

PySpark とは、Apache Spark の機能を Python から操作できるようにするための API です。
大規模なデータ処理、ETL、機械学習などの用途に広く利用されており、Pythonエンジニアでも分散処理に強い Spark を扱うことができます。

WindowsでのPySpark環境構築手順

Windows環境では、PySpark を動作させるためにいくつかの依存ソフトや設定が必要です。

1. Javaのインストール

PySpark は Java Virtual Machine(JVM)上で動作するため、まずは Java(JDK)をインストールします。

2. Apache Sparkのダウンロード

Apache Spark の公式サイトから ZIP ファイルをダウンロードし、任意のフォルダに展開します。

例:C:\spark-2.4.5-bin-hadoop2.7

3. winutils.exeの配置

Windows上でSparkを実行するためには winutils.exe が必要です。

ダウンロードした winutils.exe は、Sparkを展開したディレクトリの bin フォルダ内に配置してください。

C:\spark-2.4.5-bin-hadoop2.7\bin\winutils.exe

4. 環境変数の設定

以下の環境変数をシステムに追加します。

  • HADOOP_HOME:Sparkの展開パス
    例:C:\spark-2.4.5-bin-hadoop2.7
  • PATH%HADOOP_HOME%\bin を追加

設定方法:
コントロールパネル → システムとセキュリティ → システム → システムの詳細設定 → 環境変数

5. Sparkの動作確認

コマンドプロンプトを開き、以下を実行します:

spark-shell
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?