z411 / trackma

Open multi-site list manager for Unix-like systems. (ex-wMAL)
https://z411.github.io/trackma
GNU General Public License v3.0
761 stars 82 forks source link

After upgrading distro, graphical interfaces of Trackma doesn't work #701

Closed coolboymew2 closed 11 months ago

coolboymew2 commented 11 months ago

After upgrading my distro I've found myself unable to open Trackma anymore. I tried reinstalling and it's telling me

error: externally-managed-environment

I searched online and apparently I have to install and use pipx. I did, and I reinstalled Trackma and all of the graphical interfaces refuses to work. Curses just tell me I have a package missing, normal Trackma works in terminal

Any ideas?

Thanks


For qt

Traceback (most recent call last):
  File "/home/mew/.local/bin/trackma-qt", line 5, in <module>
    from trackma.ui.qt import main
  File "/home/mew/.local/pipx/venvs/trackma/lib/python3.11/site-packages/trackma/ui/qt/__init__.py", line 22, in <module>
    from trackma.ui.qt.mainwindow import MainWindow
  File "/home/mew/.local/pipx/venvs/trackma/lib/python3.11/site-packages/trackma/ui/qt/mainwindow.py", line 22, in <module>
    from PyQt5 import QtCore, QtGui
ModuleNotFoundError: No module named 'PyQt5'

GTK

Traceback (most recent call last):
  File "/home/mew/.local/bin/trackma-gtk", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/mew/.local/pipx/venvs/trackma/lib/python3.11/site-packages/trackma/ui/gtk/__init__.py", line 26, in main
    from .application import TrackmaApplication
  File "/home/mew/.local/pipx/venvs/trackma/lib/python3.11/site-packages/trackma/ui/gtk/application.py", line 16, in <module>
    from gi import require_version
ModuleNotFoundError: No module named 'gi'

qt4

Traceback (most recent call last):
  File "/home/mew/.local/bin/trackma-qt4", line 5, in <module>
    from trackma.ui.qt.qt4 import main
  File "/home/mew/.local/pipx/venvs/trackma/lib/python3.11/site-packages/trackma/ui/qt/__init__.py", line 22, in <module>
    from trackma.ui.qt.mainwindow import MainWindow
  File "/home/mew/.local/pipx/venvs/trackma/lib/python3.11/site-packages/trackma/ui/qt/mainwindow.py", line 22, in <module>
    from PyQt5 import QtCore, QtGui
ModuleNotFoundError: No module named 'PyQt5'
FichteFoll commented 11 months ago

You're definitely missing dependencies. Not sure where you got the pipx recommendation from, but what actually is your distro and how did you install trackma and which version?

coolboymew2 commented 11 months ago

MX Linux. I just upgraded from 21.3 to 23 through their guide. Trackma has not been opening since

As said, I tried reinstalling through pip3 and I got

`error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.`

I have no idea what this is about, but from your comment, I assume everything python broke?

qyot27 commented 11 months ago

Python didn't break, it was a deliberate change to how pip installs packages. It tells you that at the very end of the message: hint: See PEP 668 for the detailed specification.

But, you can override it by using the --break-system-packages option when using pip install (no, that name's not hyperbolic at all :sarcasm:), although that might require a newer version of pip. Applications with limited scope and few dependencies like trackma (especially few dependencies not already handled by the system repo) aren't the ones that are going to cause the kind of conflicts that this policy change in Python/pip is intended to prevent.

coolboymew2 commented 11 months ago

I got scared by the hyperbolic "--break-system-packages", but it looks like just running pip3 as usual with that command did the job and it's opening again

Thanks for the advice

Closing

sudoshindo commented 5 months ago

@coolboymew2 I experienced the exact same errors as you. I've figured out the correct way to install this using pipx.

pipx install --system-site-packages trackma
pipx inject trackma urwid
pipx inject trackma pyqt5

@z411 you might want to add this to the README.