zendalona / lios

Linux-intelligent-ocr-solution
GNU General Public License v3.0
129 stars 32 forks source link

Lios does not run on Ubuntu 22.04 #28

Open Stond0cyborg opened 1 year ago

Stond0cyborg commented 1 year ago

I recently discovered your great app! Thanks for that. I wanted to install Lios on Ubuntu on 22.04, but it will launch. Here is the error I get:

$ lios Traceback (most recent call last): File "/usr/bin/lios", line 3, in from lios.main import * File "/usr/lib/python3/dist-packages/lios/main.py", line 27, in from lios import scanner, editor, imageview, cam, ocr, preferences, speech, train_tesseract File "/usr/lib/python3/dist-packages/lios/editor.py", line 20, in from lios.ui.gtk import text_view, tree_view, widget, dialog, file_chooser, containers, window File "/usr/lib/python3/dist-packages/lios/ui/gtk/text_view.py", line 21, in from gi.repository import Gtk File "/usr/lib/python3/dist-packages/gi/init.py", line 44, in from gi.repository import _API File "/usr/lib/python3/dist-packages/gi/repository/init.py", line 23, in from ..importer import DynamicImporter File "/usr/lib/python3/dist-packages/gi/importer.py", line 33, in from .overrides import load_overrides File "/usr/lib/python3/dist-packages/gi/overrides/init.py", line 8, in from gi import PyGIDeprecationWarning ImportError: cannot import name 'PyGIDeprecationWarning' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/init.py)

hitesh-mehta commented 4 months ago

It looks like you're encountering an issue related to circular imports within the gi module used by Lios. This error often arises due to conflicts or incorrect versions of libraries. Here are some steps you can take to troubleshoot and potentially resolve this issue:

  1. Update Lios and Dependencies: Ensure that Lios and its dependencies are up to date. Run the following commands to update your system packages and Lios:

    sudo apt update
    sudo apt upgrade
  2. Reinstall Lios: Try reinstalling Lios to ensure that you have a clean installation:

    sudo apt remove lios
    sudo apt install lios
  3. Check Python Version: Verify that Lios is compatible with the Python version you have installed. It's recommended to use Python 3 for Ubuntu 22.04. You can check the default Python version by running:

    python3 --version
  4. Reinstall Python GObject Introspection (gobject-introspection): Sometimes, issues with gi module can be resolved by reinstalling gobject-introspection. Try the following commands:

    sudo apt remove --purge gir1.2-gtk-3.0 python3-gi python3-gi-cairo gir1.2-gtksource-3.0
    sudo apt install --reinstall gir1.2-gtk-3.0 python3-gi python3-gi-cairo gir1.2-gtksource-3.0
  5. Check for Python Environment Issues: Ensure that your Python environment is clean and not conflicting with other Python installations or virtual environments. Make sure PYTHONPATH and other environment variables are correctly set.

  6. Report the Issue: If the problem persists after trying these steps, consider reporting the issue to the Lios project's GitHub repository or forums. Provide them with the error log and details about your system setup (Ubuntu version, Python version, etc.).

By following these steps, you should be able to diagnose and resolve the circular import issue causing Lios not to launch properly on Ubuntu 22.04.