Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aquinary opened this issue Mar 7, 2024 · 5 comments

Comments

@aquinary
Copy link

aquinary commented Mar 7, 2024

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
Copy link
Member

DarkFenX commented Mar 7, 2024

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
Copy link
Author

aquinary commented Mar 8, 2024

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
Copy link

@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
Copy link
Member

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

@DarkFenX
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants