MeanEYE / Sunflower

Small and highly customizable twin-panel file manager for Linux with support for plugins.
GNU General Public License v3.0
427 stars 41 forks source link

Doesn't run on Arch #515

Open ghabit opened 1 year ago

ghabit commented 1 year ago

Sunflower doesn't start in archlinux,

user@pc ~]$ sunflower 
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/sunflower/__main__.py", line 165, in do_activate
    self.window = MainWindow(
  File "/usr/lib/python3.10/site-packages/sunflower/gui/main_window.py", line 87, in __init__
    self._load_styles()
  File "/usr/lib/python3.10/site-packages/sunflower/gui/main_window.py", line 931, in _load_styles
    provider.load_from_file(Gio.File.new_for_path(file_name))
gi.repository.GLib.GError: gtk-css-provider-error-quark: <broken file>:1:0Failed to import: Error opening file /usr/lib/python3.10/site-packages/styles/main.css: No such file or directory (2)

Installed package from https://aur.archlinux.org/packages/sunflower

MeanEYE commented 1 year ago

Hi. Thanks for reporting this. It seems Sunflower is having issues finding CSS file we need to modify few things in system theme. It's quite possible Python3 got upgraded so CSS is now located in for example python3.12 or something. Can you check if that directory exists: /usr/lib/python3.10/site-packages/? Thanks.

ghabit commented 1 year ago

Shure, please:

[user@pc ~]$ ls /usr/lib/python3.10/site-packages/
avahi                                      OpenImageIO
boost                                      orca
Brlapi-0.8.4-py3.10.egg-info               oslquery.so
brlapi.cpython-310-x8664-linux-gnu.so     plist.so
btrfsutil-6.0.1-py3.10.egg-info            pwquality-1.4.5-py3.10.egg-info
btrfsutil.cpython-310-x86_64-linux-gnu.so  pwquality.cpython-310-x86_64-linux-gnu.so
bytesize                                   pyatspi
cairo                                      pybind11
chardet                                    pybind11-2.10.1-py3.10.egg-info
chardet-5.0.0-py3.10.egg-info              __pycache__
clang                                      pycairo-1.21.0-py3.10.egg-info
dbus                                       PyGObject-3.42.2.egg-info
_dbus_bindings.so                          pygtkcompat
_dbus_glib_bindings.so                     PyOpenColorIO.so
drv_libxml2.py                             pyopenvdb.so
gi                                         pyxdg-0.28-py3.10.egg-info
gnomemusic                                 README.txt
gtweak                                     requests
gv.py                                      requests-2.28.1-py3.10.egg-info
_gv.so                                     setproctitle
idna                                       setproctitle-1.3.1.dist-info
idna-3.4.dist-info                         snack.py
imath.so                                   _snack.so
imobiledevice.so                           speechd
ldb.cpython-310-x86_64-linux-gnu.so        speechd_config
_ldb_text.py                               talloc.cpython-310-x86_64-linux-gnu.so
lensfun                                    tbb
lensfun-0.3.3-py3.10.egg-info              TBB-0.2-py3.10.egg-info
libear                                     TBB.py
libextern_draco.so                         tdb.cpython-310-x86_64-linux-gnu.so
libmount                                   _tdb_text.py
libproxy.py                                team
libscanbuild                               team-1.0-py3.10.egg-info
libxml2mod.so                              _tevent.cpython-310-x86_64-linux-gnu.so
libxml2.py                                 tevent.py
libxsltmod.so                              urllib3
libxslt.py                                 urllib3-1.26.12-py3.10.egg-info
lilv.py                                    volume_key.py
louis                                      _volume_key.so
louis-3.23.0-py3.10.egg-info               xcbgen
numpy                                      xdg
numpy-1.23.4-py3.10.egg-info               zbar.so
[user@pc ~]$ 
MeanEYE commented 1 year ago

Did you remove Sunflower before listing this directory?

ghabit commented 1 year ago

Yes, here is output with Sunflower installed:

[user@pc ~]$ ls /usr/lib/python3.10/site-packages/
avahi                                      orca
boost                                      oslquery.so
Brlapi-0.8.4-py3.10.egg-info               plist.so
brlapi.cpython-310-x86_64-linux-gnu.so     pwquality-1.4.5-py3.10.egg-info
btrfsutil-6.0.1-py3.10.egg-info            pwquality.cpython-310-x86_64-linux-gnu.so
btrfsutil.cpython-310-x86_64-linux-gnu.so  pyatspi
bytesize                                   pybind11
cairo                                      pybind11-2.10.1-py3.10.egg-info
chardet                                    __pycache__
chardet-5.0.0-py3.10.egg-info              pycairo-1.21.0-py3.10.egg-info
clang                                      PyGObject-3.42.2.egg-info
dbus                                       pygtkcompat
_dbus_bindings.so                          PyOpenColorIO.so
_dbus_glib_bindings.so                     pyopenvdb.so
drv_libxml2.py                             pyxdg-0.28-py3.10.egg-info
gi                                         README.txt
gnomemusic                                 requests
gtweak                                     requests-2.28.1-py3.10.egg-info
gv.py                                      setproctitle
_gv.so                                     setproctitle-1.3.1.dist-info
idna                                       snack.py
idna-3.4.dist-info                         _snack.so
images                                     speechd
imath.so                                   speechd_config
imobiledevice.so                           sunflower
ldb.cpython-310-x86_64-linux-gnu.so        Sunflower-0.5.63-py3.10.egg-info
_ldb_text.py                               talloc.cpython-310-x86_64-linux-gnu.so
lensfun                                    tbb
lensfun-0.3.3-py3.10.egg-info              TBB-0.2-py3.10.egg-info
libear                                     TBB.py
libextern_draco.so                         tdb.cpython-310-x86_64-linux-gnu.so
libmount                                   _tdb_text.py
libproxy.py                                team
libscanbuild                               team-1.0-py3.10.egg-info
libxml2mod.so                              _tevent.cpython-310-x86_64-linux-gnu.so
libxml2.py                                 tevent.py
libxsltmod.so                              urllib3
libxslt.py                                 urllib3-1.26.12-py3.10.egg-info
lilv.py                                    volume_key.py
louis                                      _volume_key.so
louis-3.23.0-py3.10.egg-info               xcbgen
numpy                                      xdg
numpy-1.23.4-py3.10.egg-info               zbar.so
OpenImageIO
[user@pc ~]$ 
MeanEYE commented 1 year ago

Okay thanks. I'll patch this thing and reach out to test the fix.

felixsanz commented 1 year ago

@MeanEYE happening here too :(

MeanEYE commented 1 year ago

@felixsanz also Arch?

felixsanz commented 1 year ago

@felixsanz also Arch?

yes. there is no error or log message in my case. i type "sunflower" in a terminal, press enter, and nothing happens. it just hangs

MeanEYE commented 1 year ago

If it just hangs it might be something else. Is there any CPU usage or something similar?

felixsanz commented 1 year ago

If it just hangs it might be something else. Is there any CPU usage or something similar?

I deleted the package already so reinstalled it again and now I can see an error:

❯ sunflower     
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/sunflower/__main__.py", line 165, in do_activate
    self.window = MainWindow(
  File "/usr/lib/python3.10/site-packages/sunflower/gui/main_window.py", line 87, in __init__
    self._load_styles()
  File "/usr/lib/python3.10/site-packages/sunflower/gui/main_window.py", line 931, in _load_styles
    provider.load_from_file(Gio.File.new_for_path(file_name))
gi.repository.GLib.GError: gtk-css-provider-error-quark: <broken file>:1:0Failed to import: Error opening file /usr/lib/python3.10/site-packages/styles/main.css: No such file or directory (2)

It's trying to import /usr/lib/python3.10/site-packages/styles/main.css but that doesn`t exist. There is no "styles" folder there.

MeanEYE commented 1 year ago

Same issue it seems. Missing CSS file. Sad thing is this is due to pkgbuild using python setup utils and ending up copying files to wrong location. I'll have to install Arch and see if I can figure this one out. There are far too many issues with setuptools.

Thanks for reporting.

ghabit commented 1 year ago

Maybe flatpak package at least for archers while this issue isn't resolved? :)

MeanEYE commented 1 year ago

I'll have to look into flatpak. Fastest solution would definitely be getting standalone file and just chmod +x on it. It's single executable file and everything works as expected there.

BoxFoxCode commented 8 months ago

The PKGBUILD for Arch on the AUR installs the svg icon into the python site-packages. I'm not sure if this is the intended method for python applications, I don't recall seeing it before, so while this hasn't been updated in awhile I'll explain here since I'm unsure which action is the appropriate one. (For sunflower , sunflower-git and the other package don't have this like, but have other issues; however there seems to be mention of this by someone else.) install -Dm644 images/sunflower.svg "${pkgdir}"/usr/lib/python${_pyver}/site-packages/images/sunflower.svg

The related sunflower code is from sunflower.common... https://github.com/MeanEYE/Sunflower/blob/ddc4836aa4fde5ecca156fabddc64d5407ac0ed0/sunflower/common.py#L92C1-L101C15

Because the PKGBUILD installs the sunflower.svg to python site-packages, and _scriptdir resolves to the python site-packages director, the above check if the svg exists is true and attempts to load the css file from there as well since it returns _scriptdir instead of the _prefixdir.

The images (including the svg) and the css are otherwise installed to /usr/share/sunflower/ as would seem appropriate, by presumably the setup.py script.


There's at least two workarounds:

Both representing a possible solution depending on whats intended, either:

That's presuming the check is otherwise fulfilling it's purpose. Both workarounds work, so either solution should work as well.


I also wonder if this might relate to the Void issue, too. I had only connected this issue with Arch because I thought to try to provide a path to open, as attempting to launch it without one would "not do anything," not displaying a GUI and not giving the css load error to terminal either.