stav121 / i3wm-themer

🎨 Theme collection manager for i3-wm
MIT License
2.23k stars 244 forks source link

ImportError: cannot import name ABC #86

Open AbelDawson opened 4 years ago

AbelDawson commented 4 years ago

Ubuntu 19.10

Traceback (most recent call last): File "i3wm-themer.py", line 12, in from i3wmthemer.models.theme import Theme File "/home/abel/i3wm-themer/i3wmthemer/models/theme.py", line 1, in from i3wmthemer.models.abstract_theme import AbstractTheme File "/home/abel/i3wm-themer/i3wmthemer/models/abstract_theme.py", line 1, in from abc import ABC, abstractmethod ImportError: cannot import name ABC

stav121 commented 4 years ago

Hello sir, what version of Python are you using?

AbelDawson commented 4 years ago

It should be python 3. I just ran the Ubuntu.sh

jdberlinski commented 4 years ago

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
cizordj commented 4 years ago

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
stav121 commented 4 years ago

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?

cizordj commented 4 years ago

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.

stav121 commented 4 years ago

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.

cizordj commented 4 years ago

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.

cizordj commented 4 years ago

I remeber one of them, x11-xserver-utils without this package the ~/.Xresources cannot be loaded and compton is missing as well.