escpos AttributeError: function 'usb_detach_kernel_driver_np' not found

0

I just want to print a ticket using escpos in windows but it throws me the following error:

AttributeError: function 'usb_detach_kernel_driver_np' not found

this is the code:

from escpos.printer import Usb

p = Usb(0x1A86,0x7584,0,0x82,0x02 )
p.text("hola")
p.cut()

this is the complete error:

Traceback (most recent call last):
      File "C:\Users\Angel\Desktop\impreimer.py", line 3, in <module>
        p = Usb(0x1A86,0x7584,0,0x82,0x02 )
      File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\escpos\printer.py", line 51, in __init__
        self.open()
      File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\escpos\printer.py", line 68, in open
        self.device.detach_kernel_driver(0)
      File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\core.py", line 1077, in detach_kernel_driver
        interface)
      File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\backend\libusb0.py", line 606, in detach_kernel_driver
        _check(_lib.usb_detach_kernel_driver_np(dev_handle, intf))
      File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 361, in __getattr__
        func = self.__getitem__(name)
      File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 366, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: function 'usb_detach_kernel_driver_np' not found
    [Finished in 0.5s]

NOTE: I'm using windows 7 64 bits

Capture printer info:

    
asked by Mystic_Force 05.08.2018 в 23:25
source

0 answers