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

Doesn't run on Arch #515

Open
ghabit opened this issue Nov 20, 2022 · 14 comments
Open

Doesn't run on Arch #515

ghabit opened this issue Nov 20, 2022 · 14 comments

Comments

@ghabit
Copy link

ghabit commented Nov 20, 2022

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

MeanEYE commented Nov 20, 2022

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

ghabit commented Nov 20, 2022

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

MeanEYE commented Nov 20, 2022

Did you remove Sunflower before listing this directory?

@ghabit
Copy link
Author

ghabit commented Nov 20, 2022

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

MeanEYE commented Nov 20, 2022

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

@felixsanz
Copy link

@MeanEYE happening here too :(

@MeanEYE
Copy link
Owner

MeanEYE commented Jan 9, 2023

@felixsanz also Arch?

@felixsanz
Copy link

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

MeanEYE commented Jan 9, 2023

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

@felixsanz
Copy link

felixsanz commented Jan 10, 2023

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

MeanEYE commented Jan 10, 2023

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

ghabit commented Jan 10, 2023

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

@MeanEYE
Copy link
Owner

MeanEYE commented Jan 10, 2023

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

BoxFoxCode commented Oct 18, 2023

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 script_dir 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 script_dir instead of the prefix_dir.

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:

  • Copying or Symlinking from the site-packages to the /usr/share directory, as suggestion by others.
  • Deleting the sunflower.svg from the site-directory, or removing that installation from the PKGBUILD, so that the script_dir check fails as returns the prefix_dir

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

  • Installing the files in the PKGBUILD or pysetup to the site-packages if they are meant to be there.
  • Not installing the svg to the site-packages, in the PKGBUILD, if it's not meant to be there.

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.

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

4 participants