Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named Leap

I have started working on Leap Motion Controller and when trying to execute my code I get this error:

ImportError: No module named Leap

I have added the path to the required libraries

import sys 
sys.path.append("usr/lib/Leap:/path/to/lib/x86:/path/to/lib")
import thread, time
from Leap import CircleGesture, KeyTapGesture, ScreenTapGesture, SwipeGesture

What am I doing wrong?

I am working on a Linux platform: Ubuntu 13.10, 32-bit

like image 329
shruti Avatar asked Sep 28 '22 22:09

shruti


1 Answers

You can't append a colon separated path list like this, as Python's sys.path stores the path entries an a list, and not a colon separated list. Each folder needs to be appended separately. Also, usr/lib/Leap looks to be missing the leading slash.

Something like this should work:

sys.path.append("/usr/lib/Leap")
sys.path.append("/path/to/lib/x86")
sys.path.append("/path/to/lib")

Or this:

sys.path += ["/usr/lib/Leap", "/path/to/lib/x86", "/path/to/lib"]
like image 86
Alexander O'Mara Avatar answered Oct 03 '22 01:10

Alexander O'Mara