ddetommaso / TobiiGlassesPyController

Tobii Pro Glasses 2 Python controller
GNU General Public License v3.0
56 stars 28 forks source link

ImportError: No module named IN #4

Closed HamAndChris closed 5 years ago

HamAndChris commented 5 years ago

Running this on Windows with 64-bit Anaconda 2.7, I get the following error message:

Traceback (most recent call last):
  File "connect.py", line 18, in <module>
    from tobiiglassesctrl.controller import TobiiGlassesController
  File "C:\ProgramData\Anaconda2\lib\site-packages\tobiiglassesctrl\controller.py", line 29, in <module>
    import IN
ImportError: No module named IN

It seems to be a somewhat common problem. The module is only used on line 110 (mksock) to import a constant, so it could easily be replaced with the numeric value which is 25.

try:
    if iptype == socket.AF_INET6 and sys.platform == "linux2":
        sock.setsockopt(socket.SOL_SOCKET, IN.SO_BINDTODEVICE, self.iface_name+'\0')
ddetommaso commented 5 years ago

Hi @HamAndChris,

thank you for reporting this issue. I modified the code to import the module IN only in linux systems, so it should work fine for you and other Windows systems as well.

Please download and check the updated version 2.0.2.

Best,