Operating system:windows10
Slicer version:4.11.0
Expected behavior: **SlicerLeapMotionControl**can work
Actual behavior:SlicerLeapMotionControl cannot work
I add the src directory to the additional module paths,but there are some errors in python.
What can I do to make the SlicerLeapMotionControl work in Slicer4.11? It can work in Slicer4.8.
Since Slicer was recently updated to use with Python 3 (see [1] for more details), extensions and more general any example of code also need to be updated to support python 3 and it seems the SlicerLeapMotionControl scripts still need to be updated to support it.
That said, there are most likely other problem to address. Could you try the updated code available in the Pull request linked above and report the other errors ?
Wow,it’s a pleasure to do the test work.
Is it after midnight in America or Canada? You replied so soon at this time.
I will try your suggestions in the future hours.
The LeapPython library included in the Leap Motion SDK supports only Python 2.7. However, the SDK also includes the SWIG interface file used to generate the LeapPython source code, so advanced users can generate and compile their own version of LeapPython. For instructions, refer to Generating a Python 3.3.0 Wrapper with SWIG 2.0.9 in our support knowledge base.
Hi ,@jcfr@lassoan i did the same thing that @JaceYang did , i build LeapPython.dll with Leap.lib(x64), it can successfully generate LeapPython.dll, so i change it to leapPython.pyd and put it into the demo1 folder to replace the old one,and then add it to 3D Slicer, but those errors have not changed comparing to the unmodified source code( original source code) and they are the same errors that Jace Yang has got.
Hi,everyone @jcfr@lassoan@JaceYang. I recently found that there is no way for me to develop a leap motion python Module on slicer 4.11.0(python 3.6.7) with leap motion V3.2(only support Python2.7). I tried Generating a Python 3.3.0 Wrapper with SWIG 2.0.9, but errors remains. and then i try to Generating a Python 3.6.7 Wrapper with SWIG 2.0.9, it failed at the beginning to produce a LeapPython.dll. So i would like to know if you guys can give me some advice? If there is no solution for this issue, i may change to develop a c++ module. Thanks in advance.
Traceback (most recent call last):
File "C:/slicerpy/leapmotion/SlicerLeapModule.py", line 20, in __init__
logic = SlicerLeapModuleLogic()
File "C:/slicerpy/leapmotion/SlicerLeapModule.py", line 164, in __init__
self.LeapController = Leap.Controller()
AttributeError: module 'Leap' has no attribute 'Controller'
I don’t think there is a mistake:
`class SlicerLeapModuleLogic(object):