i3wm-themer
i3wm-themer copied to clipboard
ImportError: cannot import name ABC
Ubuntu 19.10
Traceback (most recent call last):
File "i3wm-themer.py", line 12, in
Hello sir, what version of Python are you using?
It should be python 3. I just ran the Ubuntu.sh
Try replacing all of the python python
commands in the readme to python3
:
python3 i3wm-themer.py --config config.yaml --backup /home/[USER]/Backups
python3 i3wm-themer.py --config config.yaml --install defaults/
python3 i3wm-themer.py --config config.yaml --load themes/[theme_id].json
I'm having this problem too, but mine is a bit different. Everything compiles perfectly but in the end I get a message like this:
Traceback (most recent call last):
File "i3wm-themer.py", line 12, in <module>
from i3wmthemer.models.theme import Theme
File "/home/cezar/Downloads/i3wm-themer/i3wmthemer/models/theme.py", line 1, in <module>
from i3wmthemer.models.abstract_theme import AbstractTheme
File "/home/cezar/Downloads/i3wm-themer/i3wmthemer/models/abstract_theme.py", line 1, in <module>
from abc import ABC, abstractmethod
ImportError: cannot import name ABC
Traceback (most recent call last):
File "i3wm-themer.py", line 12, in <module>
from i3wmthemer.models.theme import Theme
File "/home/cezar/Downloads/i3wm-themer/i3wmthemer/models/theme.py", line 1, in <module>
from i3wmthemer.models.abstract_theme import AbstractTheme
File "/home/cezar/Downloads/i3wm-themer/i3wmthemer/models/abstract_theme.py", line 1, in <module>
from abc import ABC, abstractmethod
ImportError: cannot import name ABC
Read the README.md
Afterwards, when I run: $ ./change.sh 004
Traceback (most recent call last): File "i3wm-themer.py", line 11, in <module> from i3wmthemer.models.configuration import ConfigurationLoader File "/home/cezar/Downloads/i3wm-themer/i3wmthemer/models/configuration.py", line 4, in <module> import yaml ModuleNotFoundError: No module named 'yaml'
I'm running under a fresh installation of Debian testing with only Xorg and lightdm.
$ python --version
Python 2.7.17
$ python3 --version
Python 3.7.6
Content of change.sh
### Script written by James Shane ( github.com/jamesshane )
python3 i3wm-themer.py --config config.yaml --load themes/"$1".json
I think the first issue might need more investigation, once I cannot reproduce it locally. About the second one, if you run :
pip3 install -r requirements.txt
in the parent folder of the repo, doesn't it install the proper version of the yaml library?
Yes it worked! Thanks. Yaml is now installed and I can change the themes properly. Now polybar isn't working but it's another matter.
In order to make Polybar work properly you probably have to go through Polybar's wiki, maybe some of the functions are not configured properly for your case? You could try to launch it from the script directly and check the output, will probably lead you to the source of the errors.
Polybar is 100% working now, there were some problems in the config files, i just ran this command again
python i3wm-themer.py --config config.yaml --install defaults/
Now thank you so much.
The only mistake I did right from beginning was not to use pip3 instead of pip when I had to install the "requirements" and during the compilation in the "install_debian.sh" script there is a package missing, I can't remeber right now which was, but when I do I will make a PR adding this package name to the list. Without this package the compilation couldn't start.
I remeber one of them, x11-xserver-utils
without this package the ~/.Xresources cannot be loaded and compton
is missing as well.