I noticed that the script stopped working recently and I have traced this back to an update in python version.
Traceback (most recent call last):
File "/usr/local/bin/pihole5-list-tool", line 5, in
from ph5lt import main
File "/usr/local/lib/python3.10/dist-packages/ph5lt.py", line 34, in
import prompts
File "/usr/local/lib/python3.10/dist-packages/prompts.py", line 4, in
from PyInquirer import prompt, Validator, ValidationError, Separator
File "/usr/local/lib/python3.10/dist-packages/PyInquirer/init.py", line 6, in
from prompt_toolkit.token import Token
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/init.py", line 16, in
from .interface import CommandLineInterface
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/interface.py", line 19, in
from .application import Application, AbortAction
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/application.py", line 8, in
from .key_binding.bindings.basic import load_basic_bindings
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in
from prompt_toolkit.renderer import HeightIsUnknownError
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/renderer.py", line 11, in
from prompt_toolkit.styles import Style
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/styles/init.py", line 8, in
from .from_dict import *
File "/usr/local/lib/python3.10/dist-packages/prompt_toolkit/styles/from_dict.py", line 9, in
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)
Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.9.
I fixed the issue by the editing the named _fromdict.py file and replacing:
from collections import Mapping
with
from collections.abc import Mapping
Again, I'm not an expert with Python, so I don't know if this is something that you can fix or if it is an issue with a dependency, however this may prove useful to someone else if they have the same issue.
This is a super useful tool, so thanks for creating it.
Many Thanks
Hello
I noticed that the script stopped working recently and I have traced this back to an update in python version.
I am not a python expert, however from a bit of research it looks like Python3.10 has removed a deprecated feature to do with Collections: https://docs.python.org/3.9/library/collections.html#module-collections
I fixed the issue by the editing the named _fromdict.py file and replacing:
Again, I'm not an expert with Python, so I don't know if this is something that you can fix or if it is an issue with a dependency, however this may prove useful to someone else if they have the same issue.
This is a super useful tool, so thanks for creating it. Many Thanks