I have a Hadoop Cluster running on Centos 7. I am running a program (sitting on HDFS) to extract tweets and I need to import tweepy for that. I did pip install tweepy as root on all the nodes of the cluster but i still get an import error when I run the program. 
Error says: ImportError: No module named tweepy

I am sure Tweepy is installed because, pip freeze | grep "tweepy" returns tweepy==3.5.0. 
I created another file x.py with just one line import tweepy in the /tmp folder and that runs without an error. Error occurs only on HDFS.
Also, my default python is Python 2.7.12 which I installed using Anaconda. Can someone help me with this issue? The same code is running without any such errors on another cluster running on Centos 6.6. Is it an OS issue? Or do I have to look into the Cluster?
It looks like you're using Anaconda's Python to run your script, but you installed tweepy into CentOS's system installation of Python using pip. Either use conda to install tweepy, or use Anaconda's pip executable to install tweepy onto your Hadoop cluster.
Tweepy import Error on HDFS running on Centos 7