pklaus / brother_ql

Python package for the raster language protocol of the Brother QL series label printers (QL-500, QL-550, QL-560, QL-570, QL-700, QL-710W, QL-720NW, QL-800, QL-810W, QL-820NWB, QL-1050, QL-1060N and more).
GNU General Public License v3.0
558 stars 165 forks source link

Currently the printer can be specified either via an appropriate string or via an os.open() handle. #125

Open msazanov opened 2 years ago

msazanov commented 2 years ago

image INFO:brother_ql.backends.helpers:No backend stated. Selecting the default linux_kernel backend. Traceback (most recent call last): File "/home/marat/.local/bin/brother_ql", line 33, in <module> sys.exit(load_entry_point('brother-ql==0.9.dev0', 'console_scripts', 'brother_ql')()) File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/home/marat/.local/lib/python3.10/site-packages/brother_ql/cli.py", line 147, in print_cmd send(instructions=instructions, printer_identifier=printer, backend_identifier=backend, blocking=True) File "/home/marat/.local/lib/python3.10/site-packages/brother_ql/backends/helpers.py", line 57, in send printer = BrotherQLBackend(printer_identifier) File "/home/marat/.local/lib/python3.10/site-packages/brother_ql/backends/linux_kernel.py", line 49, in __init__ raise NotImplementedError('Currently the printer can be specified either via an appropriate string or via an os.open() handle.') NotImplementedError: Currently the printer can be specified either via an appropriate string or via an os.open() handle. image

Python 3.10.4 pip 22.0.4 from /home/marat/.local/lib/python3.10/site-packages/pip (python 3.10)

Hello, my printer is Brother ql-800 and I can't start printing with brother_ql, please help me, what could be the problem?

FriedrichFroebel commented 2 years ago

You are not specifying any printer device. Depending on your setup, you should use something like brother_ql -m "QL-800" -p "file:///dev/usb/lp1" -b "linux_kernel" print to use the Linux kernel backend. The device identifier might differ on your system.

Please note that you might have to run this with sudo to avoid permission errors from udev - or add dedicated rules to be able to use the USB device without sudo privileges.

msazanov commented 2 years ago

Thank you! Your answer solve my problem!

You are not specifying any printer device. Depending on your setup, you should use something like brother_ql -m "QL-800" -p "file:///dev/usb/lp1" -b "linux_kernel" print to use the Linux kernel backend. The device identifier might differ on your system.

Please note that you might have to run this with sudo to avoid permission errors from udev - or add dedicated rules to be able to use the USB device without sudo privileges.