Esse é o código que eu coloquei no meu notebook:
In [27]: 1 import findspark
2 findspark.init()
E esse foi o erro retornado ao executar o código:
IndexError Traceback (most recent call last)
File ~\anaconda3\lib\site-packages\findspark.py:159, in init(spark_home, python_path, edit_rc, edit_profile)
158 try:
--> 159 py4j = glob(os.path.join(spark_python, "lib", "py4j--.zip"))[0]
160 except IndexError:
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
Input In [27], in <!cell line: 2>()
1 import findspark
----> 2 findspark.init()
File ~\anaconda3\lib\site-packages\findspark.py:161, in init(spark_home, python_path, edit_rc, edit_profile)
159 py4j glob(os.path.join(spark_python, "lib", "py4j-.zip"))[0]
160 except IndexError:
--> 161 raise Exception(
162 "Unable to find py4j in {}, your SPARK HOME may not be configured correctly".format(
163 spark_python
164 }
165 }
166 sys.path[:0] sys_path = [spark_python, py4j] =
167 else:
168 # already imported, no need to patch sys.path
Exception: Unable to find py4j in C:\Spark\spark-3.2.4-bin-hadoop2.7\python, your SPARK HOME may not be configured correctly
Traceback (most recent call last)
```</div>