I installed python 3.7.3 using pyenv with env PYTHON_CONFIGURE_OPTS="--enable-framework"
so that the dylib
is included. Using the Leap.i
, Leap.h
, LeapMath.h
, libLeap.dylib
from SDK 2.3.1
. The only edit I made was to Leap.i
, replacing all the instances of %}}
with }}
to prevent line-indentation errors with swig. Then I successfully ran swig -c++ -python -o LeapPython.cpp -interface LeapPython Leap.i
. Then I ran:
clang++ -arch x86_64 -I/path/to/my/include/python3.7m LeapPython.cpp libLeap.dylib /path/to/my/lib/python.dylib -shared -o LeapPython.so
I discarded the -arch i386
param from an example I saw, causing an error saying symbol not found or something. Otherwise no errors and LeapPython.so
and Leap.py
generated. When I import the new Leap.py
file I get some errors:
NameError: name '__swig_getmethods__' is not defined
and
NameError: name '_newclass' is not defined
I believe the Image
, Frame
and Mask
classes each are attempting to access the above 2 items.