blacklight / leap-sdk-python3

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

NameError: name '__swig_getmethods__' is not defined #3

Closed dominikstrb closed 4 years ago

dominikstrb commented 4 years ago

Hi @BlackLight

thank you very much for making this easy to install Python 3 SDK for the Leap Motion available! When I am trying to run a script that only contains import Leap, I am getting the following error:

File "test.py", line 6, in <module>
    import Leap
  File "/home/dominik/repos/leap/lib/python3.8/site-packages/Leap.py", line 783, in <module>
    class Image(Interface):
  File "/home/dominik/repos/leap/lib/python3.8/site-packages/Leap.py", line 834, in Image
    __swig_getmethods__["data"] = data
NameError: name '__swig_getmethods__' is not defined
(psychopy) ~/repos/leap >>> python test.py                                                        [1]
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    import Leap
  File "/home/dominik/repos/leap/lib/python3.8/site-packages/Leap.py", line 783, in <module>
    class Image(Interface):
  File "/home/dominik/repos/leap/lib/python3.8/site-packages/Leap.py", line 834, in Image
    __swig_getmethods__["data"] = data
NameError: name '__swig_getmethods__' is not defined

I am guessing that this could be due to the wrong version of swig installed on my system (Arch linux currently has 4.0.2.1). Do you have any idea how I could fix this?

Thanks, Dominik

blacklight commented 4 years ago

The SDK is build against swig3. Unfortunately, swig3 has recently been removed from the Arch repo and now only versions >=4 are supported on Arch.

To make things work you can either:

Then change build.sh so that $SWIG points to the swig3 executable instead of swig.

dominikstrb commented 4 years ago

Thank you for the quick answer!