4

I am trying to get the basics of Leap Motion running in python.

import os, sys, inspect, thread, time

Code can be seen here.. http://pastie.org/10883595

I get an error ....

Traceback (most recent call last):
  File "Sample.py", line 6, in <module>
    import Leap
ImportError: No module named Leap

The file /usr/bin/Playground_Data/Plugins/x86_64/libLeap.so exists,

and I can add /usr/bin to the PYTHONPATH but it still cannot find it.

I am using ubuntu 16.04.

Any ideas how I can make this find the library?

Kevin

Shubham Sharma
  • 1,753
  • 15
  • 24
Kevin Waterson
  • 707
  • 1
  • 7
  • 23

2 Answers2

1

I had the same problem, but in Windows.

A change the Sample.py, adding the path to the Leap.py and LeapPython.pyd and it worked.

import sys
sys.path.insert(0, "../lib")
sys.path.insert(1, "../lib/x86")
DPalharini
  • 413
  • 6
  • 16
  • this worked for me, but than i get ImportError: dynamic module does not define module export function (PyInit_LeapPython) – Lorenzo Sciuto Jan 09 '20 at 16:07
  • 1
    ok this was my problem https://stackoverflow.com/questions/55277328/unable-to-solve-importerror-dynamic-module-does-not-define-module-export-funct i was using python3 in place of python 2 – Lorenzo Sciuto Jan 09 '20 at 16:14
0

You need three files in the path: Leap.py, LeapPython, and libLeap (exact filenames and extensions vary by platform).

Leap.py loads LeapPython, which loads libLeap. If you are missing any of the three files you will get the same "no module" error message.

Charles Ward
  • 1,388
  • 1
  • 8
  • 13