hhannine / superpaper

A cross-platform multi monitor wallpaper manager.
MIT License
1.14k stars 46 forks source link

Unable to start Superpaper in Arch Linux #1

Closed Roboron3042 closed 5 years ago

Roboron3042 commented 5 years ago

Trying to run the portable version of Superpaper i get the following:

Traceback (most recent call last): File "superpaper.pyw", line 28, in <module> ModuleNotFoundError: No module named 'dbus' [9080] Failed to execute script superpaper

(I'm pretty sure my system have python-dbus installed)

Now if I try to start Superpaper from the script in this repo i get the following: Traceback (most recent call last): File "superpaper.pyw", line 2638, in <module> main() File "superpaper.pyw", line 2632, in main tray_loop() File "superpaper.pyw", line 2624, in tray_loop app = App(False) NameError: name 'App' is not defined

hhannine commented 5 years ago

You are running the .pyw script in either case with presumably 3.7.X version of python? Have you installed all the dependencies? Did you verify that dbus is installed?

Alternatively, have you tried the pre-packaged linux portable release?

Roboron3042 commented 5 years ago

I'm using python 3.7.3-1

The first case is the pre.packaged linux portable release. The second is the .pyw script.

dbus, python dbus, python-pillow and screeninfo (this package from pip) are all installed.

hhannine commented 5 years ago

Thanks. I'm testing the packaged version on my Manjaro machine with no issues. One thing I'd ask you to test is to try the 'dbus' module available via pip, but otherwise I'll need to research into this why it could fail on your machine.

In the second case, did you install the wxpython module 'wx'? It's required for the GUI, though in CLI mode the script should run.

hhannine commented 5 years ago

Never mind, the dbus issue with the package is probably my fault from the pyinstaller build process. I'll try to get a new package up later today.

hhannine commented 5 years ago

I updated the linux package in the release with a new build that hopefully resolves the dbus issue that you found.

Greenscreener commented 5 years ago

Hello, I'm using the script version of Superpaper and I'm running into the same problem:

$   ./superpaper.pyw 
Traceback (most recent call last):
  File "./superpaper.pyw", line 2638, in <module>
    main()
  File "./superpaper.pyw", line 2632, in main
    tray_loop()
  File "./superpaper.pyw", line 2624, in tray_loop
    app = App(False)
NameError: name 'App' is not defined

I have OpenSUSE Tumbleweed version 20190420, I have installed all the required dependencies with pip3. It works from the command line as you said.

Greenscreener commented 5 years ago

I'm not able to set the desktop bg in i3 using feh using this command:

./superpaper.pyw -s ~/.wallpaper --command 'feh --bg-scale {image}'

No output, no wallpaper change. The ~/.wallpaper file is just a renamed PNG.

I know this is possibly unrelated, but I might as well post it here, because it might not be.

hhannine commented 5 years ago

Thanks for reporting in @Greenscreener . I think the latter problem you mention is unrelated, I'll need to check and test that the custom command usage from CLI hasn't broken in some changes.

Regarding the 'App' NameError, can you try and import the 'wx' module in python console and report back if it does something unexpected for you?

Have you tested the pre packaged version if it works for you? If not, does it give you errors to report?

hhannine commented 5 years ago

I'm not able to set the desktop bg in i3 using feh using this command:

./superpaper.pyw -s ~/.wallpaper --command 'feh --bg-scale {image}'

No output, no wallpaper change. The ~/.wallpaper file is just a renamed PNG.

I know this is possibly unrelated, but I might as well post it here, because it might not be.

If you want to use feh, you could try to just pass 'feh' as the custom command. I put it in as a special case to facilitate the usage of feh as the backend. So you'd use it as --command 'feh'. It might be that the parsing of the command string goes wrong in the case that you wrote but I'll need to look into it at some point.

EDIT: And additionally i3 should be supported as is, and passing a custom command using feh should not be necessary. Have you tried it without a custom command? Superpaper just checks that in the case of i3 there is the string "i3" somewhere in your DESKTOP_SESSION variable, so if it's empty you'll run to an issue. However as a workaround you can run it as "DESKTOP_SESSION=i3 ./superpaper.pyw". But this is only if the variable is not already set for you.

Greenscreener commented 5 years ago

Regarding the 'App' NameError, can you try and import the 'wx' module in python console and report back if it does something unexpected for you?

>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'wx'

Have you tested the pre packaged version if it works for you? If not, does it give you errors to report?

No, not yet, my internet isn't very fast, so 100-ish MiB is a pretty long time, so I decided to use the script, because dependencies are reusable. I started the download and I'll report back then.

If you want to use feh, you could try to just pass 'feh' as the custom command.

Still nothing.

And additionally i3 should be supported as is,

The DESKTOP_SESSION variable is equal to /usr/share/xsessions/i3, so it should work, but running it without a --command option still does nothing.

Greenscreener commented 5 years ago

If I run all the above mentioned commands with --debug it prints this:

['/home/jan/.lockscreen']
None
None
None
None
None
True
getDisplayData output: nDisplays = 2, [(1920, 1080), (1280, 1024)], [(1280, 0), (0, 0)]
SORTED getDisplayData output: nDisplays = 2, [(1280, 1024), (1920, 1080)], [(0, 0), (1280, 0)]
/home/jan/.lockscreen

The only differences are on the lines which I would assume list the input parameters.

hhannine commented 5 years ago

ModuleNotFoundError: No module named 'wx'

Ok so your python can't find the module. Have you installed the 'wxpython' dependency with pip?

hhannine commented 5 years ago

If you want to use feh, you could try to just pass 'feh' as the custom command.

Still nothing.

And additionally i3 should be supported as is,

The DESKTOP_SESSION variable is equal to /usr/share/xsessions/i3, so it should work, but running it without a --command option still does nothing.

Something strange is going on then, I'll have to do some testing.

getDisplayData output: nDisplays = 2, [(1920, 1080), (1280, 1024)], [(1280, 0), (0, 0)] SORTED getDisplayData output: nDisplays = 2, [(1280, 1024), (1920, 1080)], [(0, 0), (1280, 0)] /home/jan/.lockscreen

Is this all the debug printing you get, neglecting the first lines?

Greenscreener commented 5 years ago

Ok so your python can't find the module. Have you installed the 'wxpython' dependency with pip

I thought I have done, turns out I haven't. Now when I try to install it, there is A LOT of output, not all of it is meaningful I guess. Just for sure here's the full thing: https://hastebin.com/lifebapaya.txt

Is this all the debug printing you get, neglecting the first lines?

Note exactly sure what you mean. There is no additional lines, but the Nones change according to passed parameters.

hhannine commented 5 years ago

Just for sure here's the full thing: https://hastebin.com/lifebapaya.txt

Looks like the installation process fails during the build configuration, maybe there are missing dependencies of the wxpython library, which of there are quite a few. I link to a resource on wxpython in the readme. The pre packaged version has these bundled in so you wouldn't need to fight with the wxpython installation process which can be quite laborious. However I'm a bit anxious of whether you'll run into problems even with the packaged version if the script CLI mode doesn't properly set the wallpaper either..

Just to double check, you have feh installed and you can set your wallpaper with it from the terminal?

Edit: from the linked paste: "No package 'gtk+-3.0' found". If you want to use the script in GUI mode, you'll need to install all the packages required by wxpython and then wxpython itself. Check out the "What you need" from here: https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html

Greenscreener commented 5 years ago

Just to double check, you have feh installed and you can set your wallpaper with it from the terminal?

Yes, that works normally. I use feh in my i3 config to set the wallpaper.

Anyway I'll try continuing tomorrow, because it's currently half past midnight in my timezone and I want to get some sleep. Thanks for your quick communication so far.

hhannine commented 5 years ago

Conclusions: Problem 1 from OP: No module dbus. Was a problem with the initial packaged version, has been fixed. Problem 2 from OP: NameError: name 'App' is not defined. This is probably due to a problematic wx module installation. v1.1.2 reports if this is the case.

Problem 3 from @Greenscreener: CLI didn't set the wallpaper at all. This is now fixed in v1.1.2.

I'm closing this issue since it's becoming quite convoluted. Open new more specific issues as needed.

NeonHorizon commented 5 years ago

Just testing on KDE Neon 5.15 (latest version based on 18.04 LTS). I'm getting the same DBUS error with the portable version downloaded from here: https://github.com/hhannine/Superpaper/releases

However doing a manual install like so solves the problem: git clone https://github.com/hhannine/Superpaper.git sudo apt -y install python3 python3-pip python3-dbus pip3 install Pillow pip3 install screeninfo pip3 install system_hotkey pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython Superpaper/superpaper.pyw

hhannine commented 5 years ago

Thanks for the successful install notes @NeonHorizon! Just to double check, did you download the portable version recently (after I made the note "Minor update: Linux package was updated to fix a KDE specific issue.")? If so I probably need to get my hands on a KDE system to test and figure out what's going wrong.

NeonHorizon commented 5 years ago

I'm not sure which version I got, I went to the link here: https://github.com/hhannine/Superpaper/releases And downloaded superpaper-portable-linux.zip and it was at the same time I posted my comment, so theoretically after you uploaded the fix? I guess I could have got an older version cached somewhere in the chain though?

Greenscreener commented 5 years ago

Just an update: Installed wxPython from openSUSE's repository and wverything now works. I have cloned the repository, to get the latest changes with the cli fix and it works correctly.

Roboron3042 commented 5 years ago

I'm still getting the dbus error with the portable versions. However, as others have mentioned, installing wxPython solved the second case (remember it was marked as optional dependency).

hhannine commented 5 years ago

Thanks for reporting back on the CLI fix @Greenscreener!

@NeonHorizon, @Roboron3042, I realized that I had a second problem that I had missed with the Pyinstaller builds that caused the dbus import error. I think I finally resolved it today by upgrading Pyinstaller to newest developer version (3.5.X), but I'll do some further testing before posting a new release.

Maybe I'll need to clarify the bit on the dependencies that wxpython is required for the GUI, and that only CLI works without it.