title: Using PySpark in Python: WindowsError: [Error 5] Access is denied
body: <p>I'm trying to run PySpark unit tests using PyBuilder under Windows 10</p>
  
  <pre><code>pyb_ clean install
  </code></pre>
  
  <p>All the necessary libraries are included into PYTHONPATH and they are available.</p>
  
  <p>But when running I get the following error:</p>
  
  <pre><code>..\..\src\unittest\python\client_tests.py:11: in &lt;module&gt;
      from ut_setting import spark
  ..\..\src\unittest\python\ut_setting.py:75: in &lt;module&gt;
      spark = SparkSession.builder.master("local[4]").getOrCreate()
  ..\python\pyspark\sql\session.py:169: in getOrCreate
      sc = SparkContext.getOrCreate(sparkConf)
  ..\python\pyspark\context.py:307: in getOrCreate
      SparkContext(conf=conf or SparkConf())
  ..\python\pyspark\context.py:115: in __init__
      SparkContext._ensure_initialized(self, gateway=gateway, conf=conf)
  ..\python\pyspark\context.py:256: in _ensure_initialized
      SparkContext._gateway = gateway or launch_gateway(conf)
  ..\python\pyspark\java_gateway.py:82: in launch_gateway
      proc = Popen(['spark-submit.cmd', "-f"])
  D:\Python27\Lib\subprocess.py:672: in __init__
      errread, errwrite)
  D:\Python27\Lib\subprocess.py:882: in _execute_child
      startupinfo)
  E   WindowsError: [Error 5] Access is denied
  </code></pre>
  
  <p>I've also tried to use different approaches: running using admin permissions, moving to another drive and etc.</p>
  
  <p>If I do the same on Linux, it works fine without any tuning.</p>
  
  <p>Do you have any thoughts?</p>
  
  <p>Thanks!</p>