Python is not picking up Pyspark or any other packages

Hi Team,

I am working on pyspark library. Developing python code where I am trying to access Pyspark modules and getting no such module error. looks like not able to find spark path.

Please help me with this regards.

Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import pyspark
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named pyspark
Thanks,
Mukkanti

Hi @mukkanti_nalabolu,

Did you run above command in Python sell or PySpark shell?

Hi Abhinav,

Thnaks for your quick response. I am running it on Python shell.

Thnaks,
Mukkanti

Hi Abhinav,

I did some research and found that the following solution should fix it.

import findspark
findspark.init()

But findspark package also not available. Please help me out.

Thanks,
Mukkanti

Hi,

Can we install findspark package? I tried but getting permission denied error:

$ pip install findspark
Collecting findspark
Downloading https://files.pythonhosted.org/packages/b1/c8/e6e1f6a303ae5122dc28d131b5a67c5eb87cbf8f7ac5b9f87764ea1b1e1e/findspark-1.3.0-py2.py3-none
-any.whl
Installing collected packages: findspark
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: ‘/usr/lib/python2.7/site-packages/findspark.py’

1 Like