PalmaLuv / SteamGiftBot

Software to automate YOUR actions on SteamGift site, turn it on and enjoy it.
Mozilla Public License 2.0
31 stars 3 forks source link

ImportError: cannot import name 'Mapping' from 'collections' #20

Open Mte90 opened 8 months ago

Mte90 commented 8 months ago

I am getting this error with python 3.11 but the readme doesn't specify the python version required. Looking atthe version seems that PyInquirer uses an old version of prompt_toolkit, that project has a ticket https://github.com/CITGuru/PyInquirer/issues/181 and the whole project seems abandoned

Traceback (most recent call last):
  File "/home/mte90/Desktop/kde/SteamGiftBot/main.py", line 12, in <module>
    import client as clientLog
  File "/home/mte90/Desktop/kde/SteamGiftBot/client.py", line 11, in <module>
    from PyInquirer import ValidationError, Validator, prompt
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/PyInquirer/__init__.py", line 6, in <module>
    from prompt_toolkit.token import Token
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/application.py", line 8, in <module>
    from .key_binding.bindings.basic import load_basic_bindings
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in <module>
    from prompt_toolkit.renderer import HeightIsUnknownError
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/renderer.py", line 11, in <module>
    from prompt_toolkit.styles import Style
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/styles/__init__.py", line 8, in <module>
    from .from_dict import *
  File "/home/mte90/Desktop/kde/SteamGiftBot/env/lib/python3.11/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.11/collections/__init__.py)
PalmaLuv commented 5 months ago

Many thanks, found a InquirerPy [link] analog that is much newer than PyInquirer (latest release June 28, 2022), which will definitely be supported on newer versions of python.