Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to get blabel going
#1
I think I may have run square into a brick wall regarding my attempt to assemble a script for printing QR code labels with the blabel module. It looked like a workable solution so I thought that I would try it. After fulfilling all documented requirements, I am doing a debug run and up pops one more (no surprise!)... 'gobject'.

Therefore, I pull up Pypi and search to find it, look and there is one wheel file for it, so I download and PIP it. Then I attempt to run the debugger again when I notice that the version of gobject it wants is 2.0 or greater.

Since this was the extent to what was on Pypi, I jumped over to my backup source to see if I can find a more recent version there.

There I find what appears to be a version 2.28 which I pulled down, started to PIP, and realized it was for Python 2 not 3.

So, two questions...
I am headed off to search projects for a more updated 3.x python version of gobject. If anyone knows of a direct link to a version 2.x of this it would be greatly appreciated. In the meantime, the knot in my stomach is telling me that the blabel is too old to be working with and that I need to find another solution for printing QR code labels with text. Therefore, if any of you have suggestions in that vein, I am all ears.

Github here I come...


Thanks!
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply
#2
(Mar-10-2020, 10:33 AM)KipCarter Wrote: another solution for printing QR code
check if these will work for you

https://pypi.org/project/qrcode/
https://pypi.org/project/PyQRCodeNG/

EDIT: looking at blabel setup.py - it uses qrcode.
I don't see gobject listed as requirement, though.

Remind me - you were on Windows or Linux?
I tried to install blabel on Windows and it went OK.
When I run it I get following error
Error:
Traceback (most recent call last): File "c:\some_path\somefile.py", line 1, in <module> from blabel import LabelWriter File "c:\some_path\lib\site-packages\blabel\__init__.py", line 5, in <module> from .blabel import LabelWriter File "c:\some_path\lib\site-packages\blabel\blabel.py", line 6, in <module> from weasyprint import HTML File "c:\some_path\lib\site-packages\weasyprint\__init__.py", line 440, in <module> from .css import preprocess_stylesheet # noqa isort:skip File "c:\some_path\lib\site-packages\weasyprint\css\__init__.py", line 30, in <module> from . import computed_values, media_queries File "c:\some_path\lib\site-packages\weasyprint\css\computed_values.py", line 18, in <module> from .. import text File "c:\some_path\lib\site-packages\weasyprint\text.py", line 14, in <module> import cairocffi as cairo File "c:\some_path\lib\site-packages\cairocffi\__init__.py", line 50, in <module> ('libcairo.so', 'libcairo.2.dylib', 'libcairo-2.dll')) File "c:\some_path\lib\site-packages\cairocffi\__init__.py", line 45, in dlopen raise OSError(error_message) # pragma: no cover OSError: no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so': error 0x7e cannot load library 'libcairo.2.dylib': error 0x7e cannot load library 'libcairo-2.dll': error 0x7e
It is known, closed issue: https://github.com/Edinburgh-Genome-Foun...l/issues/1

The problem is with cairocffi. There is requirement https://cairocffi.readthedocs.io/en/stab...on-windows

I am not able to install it on windows right now, but also I don't face qobject requirement (at least so far)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I'm on windows normally, and a little iOS, but that is just for reading QR not sending it to a printer. I'll check out those two links... Tx

(Mar-10-2020, 10:50 AM)buran Wrote: check if these will work for you

https://pypi.org/project/qrcode/
https://pypi.org/project/PyQRCodeNG/

PyQRCodeNG looks perfect for my needs, except for the need for this to be sent to a printer to be written on a label. Likely the SVG option would make the most sense so it can be scaled easily.

This is what I enjoy about Python, one thing leads to another, and another, and...

Thanks for the links buran!
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply
#4
(Mar-10-2020, 11:28 AM)KipCarter Wrote: PyQRCodeNG looks perfect for my needs, except for the need for this to be sent to a printer to be written on a label. Likely the SVG option would make the most sense so it can be scaled easily.

Testing it out PyQRCodeNG is awesome for generating the QR code. I'd rather not send the QR Code to disk, but go directly to a printer with it (preferably a label printer).
[Image: famous-joke.png]

This, with three lines of code.

Bing'ing all over for a means to output to printer, but not coming up with anything that looks usable.
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020