1

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.

warl0ck
  • 3,356
  • 4
  • 27
  • 57
  • 1
    You ran `sudo pip install`... You can read http://stackoverflow.com/questions/21055859/what-are-the-risks-of-running-sudo-pip – OneCricketeer Jun 05 '16 at 13:30
  • I wasn't exactly i was looking for but yeah i figured out the problem the permissions were wrong. – warl0ck Jun 05 '16 at 14:10

1 Answers1

0

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

warl0ck
  • 3,356
  • 4
  • 27
  • 57