I am using Ubuntu 14.04
I have installed a module pymavlink using sudo pip install pymavlink 
now when i run a code like

python code.py

it says no module names as pymavlink but when i run it as 

sudo python code.py

it works fine, i don't understand whats the problem without sudo. 
Also i have Python 2.7 and python 3 installed as they both came with Ubuntu.
can someone please let me know the fix for this.
I found the solution for the problem, it had permission issues, normal user didn't had the permission to execute the command, hence i added it by running the command

sudo chmod 775 python2.7

and same inside for its sub folders as well.

sudo chmod 775 *

and now its working fine, i can import everything i install from pip or sudo pip
python module import error without sudo