numirias / qtile-plasma

🔮 A flexible, tree-based layout for Qtile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"from plasma import Plasma" crashes qtile on Ubuntu

sminez opened this issue · comments

I'm running Ubuntu 16.04 and even just importing the Plasma class seems to crash qtile and cause it to resort to the default config. Any ideas why this is happening?

Plasma is installed correctly and I've had a look through the source and I can't see anything in the __init__ that could be running on import. Is import order important?

Thanks for reporting!

My guess is that Qtile doesn't recognize newly installed modules until it's completely restarted, giving you an import error. So the first time after installing Plasma you probably need to at least restart the X session - Just reloading the config isn't enough.

If that solves it for you, I'll add a note in the readme. I think this is something that needs to be fixed in the Qtile core.

If that doesn't work, could you share the error traceback? A log should be somewhere around ~/.local/share/qtile/qtile.log.

Thanks for the speedy reply! Looks like the error I'm getting is this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/libqtile/confreader.py", line 55, in __init__
    config = __import__(os.path.basename(fname)[:-3])
  File "/home/innes/.config/qtile/config.py", line 7, in <module>
    from plasma import Plasma
  File "/usr/local/lib/python3.5/dist-packages/plasma/__init__.py", line 1, in <module>
    from .layout import Plasma
  File "/usr/local/lib/python3.5/dist-packages/plasma/layout.py", line 6, in <module>
    from .node import Node, AddMode, NotRestorableError
  File "/usr/local/lib/python3.5/dist-packages/plasma/node.py", line 3, in <module>
    from enum import Enum, Flag, auto
ImportError: cannot import name 'Flag'

Looks like Flag is 3.6 only. Is Plasma only compatible with 3.6? The rest of the package seems fine other than the 3.6 only enum stuff.

Damn! I somehow thought the major distributions had adopted 3.6. Thanks for digging that up, makes sense to backport then. I'll let you know, when I got it fixed.

Yeah sadly a lot of Ubuntu users are still on 3.5, No idea what Debian is on but I suspect it's lower than that!

Do you mind checking if the new release fixes it?

Enum seemed to be the only compatibility issue here.

Of course 😃 is it available through pip or do I need to install from source?

Already on pip. :-) Just make sure you pip install --upgrade.

@sminez Did you have a chance to check if the installation works fo you now?

Good lord! Best of luck getting your system back up, and thanks for all the feedback.

Travis runs the build against Ubuntu 14 + Python 3.5 without errors, so I had really hoped there is no more problem with the package.

Your initial crash could be related to the problem I first suspected (that Qtile doesn't recognize new modules without a complete restart). Another idea would be that Qtile and Plasma aren't installed for the same Python version.

There are also some methods to test your changed config without risking to crash the current session. For example, you can switch to a different tty (usually using CTRL+ALT+F1-12) from where you can then start a new X session without killing the current one (as also explained in the Qtile hacking chapter).

Back up and running with some data loss - but not too bad. Serves me right for not having a proper backup policy!

Anyway, I'm happy to say that your patch works: Plasma now runs under 3.5 👍

Great, thanks for your help!