CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 235 forks source link

Use latest prompt_toolkit #194

Open J4NS-R opened 1 year ago

J4NS-R commented 1 year ago

This resolves an import error in the collections library when using python 3.10 or higher.

ImportError: cannot import name 'Mapping' from 'collections' (/opt/homebrew/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
cdelahanty commented 1 year ago

Love the 3.10 migration work! Forced the update to prompt_toolkit=3.0.32 on my machine and it introduces an import error. More work would need to resolve that: image

S4nd3sh commented 11 months ago

I know the PyPi is not up to date and forces users to install older prompt-toolkit.

The workaround for me that worked is to install from the latest commit. It did pull the prompt-toolkit 3.x.xx and didn't raise any errors when loading it. 'pyInquirer @ git+https://github.com/CITGuru/PyInquirer.git#7637373429bec66788650cda8091b7a6f12929ee'

The change I made in the code moving from PyPi install is change the import of prompt from PyInquirer, from PyInquirer import prompt change to from PyInquirer.prompt import prompt