Apache spark2 using python 3


#1

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”)
print(sc.textFile(“C:\deckofcards.txt”).first())

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


#2

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


#3

(upload://lrwa0UMLLTQIBMVkpP4KeEOBty7.png)

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


#4

image


#5

@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?


#6

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??


#7

Please check the project structure from pycharm.
Capture2


#8

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


#9

Yes, file exists in given path.


#10

@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.