# Running a ZIP-packaged PySpark job using Add Step EMR JobFlow

**URL:** <https://community.sparkflows.ai/t/running-a-zip-packaged-pyspark-job-using-add-step-emr-jobflow/313>\
**Category:** Pipelines\
**Tags:** troubleshooting\
**Created:** [March 2, 2026, 7:36am UTC](https://community.sparkflows.ai/t/running-a-zip-packaged-pyspark-job-using-add-step-emr-jobflow/313 "2026-03-02T07:36:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@admin](https://community.sparkflows.ai/u/admin)\
**Post date:** [March 2, 2026, 7:36am UTC](https://community.sparkflows.ai/t/running-a-zip-packaged-pyspark-job-using-add-step-emr-jobflow/313/1 "2026-03-02T07:36:32Z")

</div>

We are packaging PySpark utilities into a ZIP file and using Sparkflows to build the EMR workflow with the **Add Step – EMR JobFlow** node to add steps to the cluster.

Example of running the Python script in a ZIP file. The **`my_job_test.zip`** has the following structure:

> my\_job\_test.zip  
> ├── main.py  
> └── utils.py

To run **`main.py`** in the ZIP file via AddStepEMRJobFlow:

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/sparkflows/original/1X/a60ace93b4c1c3ab08f35aaef5d3cf98942d33c5.jpeg)

### Cleanup → Download → Unzip → Run

**Argument:**

> **bash,-c,“rm -f /tmp/my\_zip\_test.zip && rm -rf /tmp/my\_zip\_test && hdfs dfs -copyToLocal s3://sparkflows-airflows-2026/TestingDirectory/my\_zip\_test.zip /tmp/my\_zip\_test.zip && unzip -o /tmp/my\_zip\_test.zip -d /tmp/my\_zip\_test && spark-submit --master yarn --deploy-mode client --py-files /tmp/my\_zip\_test.zip /tmp/my\_zip\_test/main.py”**

The above command is added as a step in EMR.

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/sparkflows/original/1X/1239a9afdc9ae9635f02b3cdffabea7824a8b433.jpeg)
