LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2023, 08:00 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
Lios OCR not working in Ubuntu 22.04


In the past I have always used Lios to get text from jpgs or pdfs.

Lios always worked great for me in Ubuntu 20.04!

Now, in Ubuntu 22.04 it won't work. A gtk error.

I used

Quote:
sudo apt-get purge lios
Then I reinstalled, but I am getting the same error, please see below.

Any tips on how to fix this please?

Quote:
pedro@pedro-HP:~$ lios
/usr/lib/python3/dist-packages/lios/ui/gtk/text_view.py:21: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
/usr/lib/python3/dist-packages/lios/ui/gtk/widget.py:24: PyGIWarning: Atk was imported without specifying a version first. Use gi.require_version('Atk', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import Atk
Traceback (most recent call last):
File "/usr/bin/lios", line 3, in <module>
from lios.main import *
File "/usr/lib/python3/dist-packages/lios/main.py", line 27, in <module>
from lios import scanner, editor, imageview, cam, ocr, preferences, speech, train_tesseract
File "/usr/lib/python3/dist-packages/lios/editor.py", line 20, in <module>
from lios.ui.gtk import text_view, tree_view, widget, dialog, file_chooser, containers, window
File "/usr/lib/python3/dist-packages/lios/ui/gtk/widget.py", line 166, in <module>
class Separator(Gtk.HSeparator):
File "/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 32, in __getattr__
return getattr(self._introspection_module, name)
File "/usr/lib/python3/dist-packages/gi/module.py", line 123, in __getattr__
raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Gtk' object has no attribute 'HSeparator'
pedro@pedro-HP:~$
 
Old 03-30-2023, 08:06 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Code:
PyGIWarning: Gtk was imported without specifying a version first. Use 
gi.require_version('Gtk', '4.0') before import to ensure that the right version gets 
loaded.
That looks like the issue. There was gtk-1.x and it stayed alive longer than it should have. Gtk-2.x & gtk-3.x are current, but guys must be working on gtk-4.x even while gtk-3.x is getting sorted.

So, something is saying "load gtk" and it's thinking "GTK what??" So it's guessing, and the guess is wrong. Tesseract isn't big into eye candy, so I guess it's Lios that's running gtk. Try specifying gtk-2.x or if that fails, gtk-3.x.
 
Old 04-06-2023, 07:06 AM   #3
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks for the reply, only just noticed!

I am not really sure how or where I can change lios.

I looked up gocr, and that works for me now. Shame, I always liked LIOS!

I may need a bash script to help me with larger OCR requirements, but mostly, I only ever need 1 or 2 pages scanned.

I just hope an update somewhen will get LIOS back on track!
 
Old 04-06-2023, 01:52 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I'm far from the most up-to-date guy here, but palemoon has gtk-2.x, and gtk-3.x versions. My system works better on gtk-2.x. The full version numbers are gth-x.y.z, where
  • z= bug fix
  • y = feature addition.
  • x = Break in compatability.
Now Lios is looking for gtk-4? You'd do better to get a version for gtk-2 or 3.

I found gocr poorly maintained and underperforming. Tesseract was the best but give it plenty of dpi in the input. Lios is on sourceforge. It should say what gtk it works with.

Last edited by business_kid; 04-06-2023 at 01:56 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OCR software for Kubuntu/Ubuntu? vmelkon Ubuntu 2 10-21-2021 07:10 AM
[SOLVED] How to add Chinese to Lios ocr? Pedroski Linux - Software 4 03-07-2019 04:30 PM
LXer: Tesseract OCR: Installation and Usage on Ubuntu 16.04 LXer Syndicated Linux News 0 05-04-2017 10:03 PM
LXer: Optical Character Recognition With Tesseract OCR On Ubuntu 7.04 LXer Syndicated Linux News 0 08-30-2007 06:30 PM
OCR initialization failed accessing OCR device: PROC-26 cheeku Linux - Software 0 09-19-2004 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration