blacklight / leap-sdk-python3

Leap Motion SDK - Python 3 module builder
17 stars 5 forks source link

__swig_getmethods__ no longer exists in swig 4.x #5

Open turtleizzy opened 2 years ago

turtleizzy commented 2 years ago

If you encountered NameError: name '__swig_getmethods__' is not defined like me, use swig 3.0.12 to compile instead of swig 4.x.

Ubuntu >20.04 ships only swig 4.x in apt sources so you will need to compile swig 3.0.12 from the source and set the proper path in build.sh.

Don't forget to find a working libpcre.so.1 because swig 3.0.12 needs that and it is also not installable from apt sources.

vrbadev commented 1 year ago

Or just comment out every use of __swig_getmethods__ and of _swig_property in the Leap.py file, ie. lines 834-837, 881-882 and 1315-1316. Then everything works just fine with swig 4.x.

You can simply remove them using: sed -i.bak '/__swig_getmethods__/d;/_swig_property/d' ./Leap.py