Apache spark2 using python 3


Hi Team,

i am getting below error when i am running this command. Please help me resolve this issue.
sc = SparkContext(master=“local”,appName=“Spark Demo”)

org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/C:/deckofcards.txt


@p.chandra_babu_Chand Can you paste environment variables and PATH variables screenshot.



Please find the attached environment variable screenshot. Please let me know if anything missing.




@p.chandra_babu_Chand Can you please check whether pyspark is running at your command prompt or not? If it is not running please set the path in the environment variables correctly(go through this blog to set the path). If it is running can you share the screenshot of your project structure?


Yeah, pyspark is working in command prompt, it seems no issue with environment variables. Below is the error screen shot from command prompt. What is project structure means, are you looking of the pycharm project structure??


Please check the project structure from pycharm.


@p.chandra_babu_Chand Can you check file is exist in the given path or not?


Yes, file exists in given path.


@p.chandra_babu_Chand Can we make Team viewer call. Are you based out of India or US. Let me know what time (In IST) you can connect through team viewer.