pyfa-org / Pyfa

Python fitting assistant, cross-platform fitting tool for EVE Online
GNU General Public License v3.0
1.59k stars 403 forks source link

ImportError: libnotify.so.4: cannot open shared object file: No such file or directory #2598

Closed aquinary closed 2 months ago

aquinary commented 4 months ago

Bug Report

 /r/m/S/Downloads  appimage-run pyfa-v2.58.1-linux.AppImage 
Uncompress pyfa-v2.58.1-linux.AppImage of type 02 @ offset 193728
[======================================================================================================================================================================================================================================================-] 46521/46521 100%
pyfa-v2.58.1-linux.AppImage is now installed in /home/aquinary/.cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c
Traceback (most recent call last):
  File "/home/aquinary/.cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c/opt/pyfa/pyfa.py", line 27, in <module>
    import config
  File "/home/aquinary/.cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c/opt/pyfa/config.py", line 4, in <module>
    import wx
  File "/home/aquinary/.cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c/usr/local/lib/python3.11/dist-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/home/aquinary/.cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c/usr/local/lib/python3.11/dist-packages/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: libnotify.so.4: cannot open shared object file: No such file or directory

Expected behavior:

Pyfa run

Actual behavior:

Pyfa crash

Detailed steps to reproduce:

use appimage-run in nixos and run pyfa.appimage

Release or development git branch? Please note the release version or commit hash:

Release, v2.58.1

Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):

NixOS 23.11

Other relevant information:

As I understand it, this problem is caused by the specifics of nixos, so this can most likely be solved by adding libnotify.so.4 to the appimage

DarkFenX commented 4 months ago

It's always a tradeoff between smaller image size and better compatibility. Biggest pain is compatibility issue, but fortunately it's not the case here.

aquinary commented 4 months ago

As I understand it, this problem is caused by the specifics of nixos, so this can most likely be solved by adding libnotify.so.4 to the appimage

I tried to put libnotify.so.4 in all directories in .cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c where there is a lib dir and other .so libraries are nearby, but this did not give any result and the error did not change

logenkain commented 2 months ago

@aquinary

I assume the pyfa team doesn't have the interest and resources to make sure the app-image is compatible with niche distributions like NixOS. In most distros, lib-notify is readily available to app images.

However, I have found a solution that worked for me.

find -iname libnotify.so.4

One of the results for me:

./.local/share/Steam/ubuntu12_64/steam-runtime-sniper/var/tmp-OCKSL2/usr/lib/x86_64-linux-gnu/libnotify.so.4

Note: I am grabbing a 64 bit version.

If you don't use steam, you'll have to find the 64 bit version of libnotify.so.4 somewhere else.

Then we copy libnotify.so.4 into the appimage-run cache directory.

In your case:

cp libnotify.so.4 .cache/appimage-run/7a9598985e4d0edf0cb59f121950a9e79c347fc7c49343ecc4ed10a66a2d109c/lib/x86_64-linux-gnu/

Recap: You need to copy the 64 bit libnotify lib into the 64 bit folder in your appimage-run cache for pyfa. We will probably need to do this for every release.

This is a nix-os/app-image issue, nixos will need to properly package pyfa app image with libnotify, or the pyfa team will have to include the library in the app image.

DarkFenX commented 2 months ago

I will experiment with all those missing dependencies. I just visit this repo mostly when it's time to do another release.

DarkFenX commented 2 months ago

Included with 71d6830ac01061f7626a12d2b0a061757b0a4723. Let's hope nothing breaks by including it (sometimes it does).