By using this site, you acknowledge that you have read and understand our Cookie policy, Privacy policy and Terms .

When running pyspark or spark-submit command in Windows to execute python scripts, you may encounter the following error:

PermissionError: [WinError 5] Access is denied

As it’s self-explained, permissions are not setup correctly.

To resolve this issue you can try different approaches:

  • Run the program as an Administrator
  • Or configure the security for your PySpark executable properly.

pyspark command exists in your ‘bin’ subfolder under Spark home folder. Make sure the permissions are configured correctly for the user that you are using to execute the script.

image

In my system, the error occurred because my current user has no permission to the Spark folder and its subfolders.

info Last modified by Raymond at 2 years ago * This page is subject to Site terms.

More from Kontext

PySpark Read Multiple Lines Records from CSV

local_offer pyspark local_offer spark-2-x local_offer python

visibility 6
thumb_up 0
access_time 1 day ago

CSV is a common format used when extracting and exchanging data between systems and platforms. Once CSV file is ingested into HDFS, you can easily read them as DataFrame in Spark. However there are a few options you need to pay attention to especially if you source file: Has records ac...

open_in_new View

local_offer pyspark local_offer spark-2-x local_offer teradata local_offer SQL Server

visibility 45
thumb_up 0
access_time 12 days ago

In my previous article about  Connect to SQL Server in Spark (PySpark) , I mentioned the ways t...

open_in_new View

local_offer python local_offer SQL Server

visibility 132
thumb_up 0
access_time 2 months ago

Python JayDeBeApi module allows you to connect from Python to databases using Java JDBC drivers.

open_in_new View

Spark Read from SQL Server Source using Windows/Kerberos Authentication

local_offer pyspark local_offer SQL Server local_offer spark-2-x

visibility 134
thumb_up 0
access_time 2 months ago

In this article, I am going to show you how to use JDBC Kerberos authentication to connect to SQL Server sources in Spark (PySpark). I will use  Kerberos connection with principal names and password directly that requires  ...

open_in_new View

info About author

Kontext Column

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.

Learn more arrow_forward
info Follow us on Twitter to get the latest article updates. Follow us