ImportError: No module named Leap

shruti

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

Alexander O'Mara

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"]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related