I'm getting ImportError from the title of the issue. I've tried installing prompt_toolkit versions 1.0.13, 1.0.14, 1.0.15, 1.0.18, installing version 3.0.x results yet another import error.
Platform: Windows 10
Python version: 3.7.7
PyInquirer version: 1.0.2
Here is my code:
from __future__ import print_function, unicode_literals
from pprint import pprint
from PyInquirer import style_from_dict, Token, prompt, Separator
from examples import custom_style_2
def get_delivery_options(answers):
options = ['bike', 'car', 'truck']
if answers['size'] == 'jumbo':
options.append('helicopter')
return options
questions = [
{
'type': 'list',
'name': 'theme',
'message': 'What do you want to do?',
'choices': [
'Order a pizza',
'Make a reservation',
Separator(),
'Ask for opening hours',
{
'name': 'Contact support',
'disabled': 'Unavailable at this time'
},
'Talk to the receptionist'
]
},
{
'type': 'list',
'name': 'size',
'message': 'What size do you need?',
'choices': ['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'],
'filter': lambda val: val.lower()
},
{
'type': 'list',
'name': 'delivery',
'message': 'Which vehicle you want to use for delivery?',
'choices': get_delivery_options,
},
]
answers = prompt(questions, style=custom_style_2)
pprint(answers)
Entire traceback:
File "select.py", line 52, in answers = prompt(questions, style=custom_style_2)
File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInquirer\prompt.py", line 75, in promp t eventloop=eventloop)
File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\shortcuts.py", line 570, in run_application eventloop = eventloop or create_eventloop()
File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\shortcuts.py", line 94, in create_eventloop from prompt_toolkit.eventloop.win32 import Win32EventLoop as Loop
File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\eventloop\win32.py", line 12, in from .inputhook import InputHookContext
File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\eventloop\inputhook.py", line 29, in from .select import select_fds
File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\eventloop\select.py", line 8, in import select
File "E:\Python\PY_cli_ui\select.py", line 52, in answers = prompt(questions, style=custom_style_2) File "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInquirer\prompt.py", line 75, in prompt eventloop=eventloop)
File "C:\Users\rokob\AppData\LocalFile "C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\shortcuts.py", line 94, in create_eventloop from prompt_toolkit.eventloop.win32 import Win32EventLoop as Loop
ImportError: cannot import name 'Win32EventLoop' from 'prompt_toolkit.eventloop.win32' (C:\Users\rokob\AppData\Local\Programs\Python\Python37\lib\site-packages\prompt_toolkit\eventloop\win32.py)\Programs\Python\Python37\lib\site-packages\prompt_toolkit\shortcuts.py", line 570, in run_application eventloop = eventloop or create_eventloop()
I'm getting ImportError from the title of the issue. I've tried installing
prompt_toolkit
versions1.0.13
,1.0.14
,1.0.15
,1.0.18
, installing version 3.0.x results yet another import error. Platform: Windows 10 Python version: 3.7.7PyInquirer
version: 1.0.2 Here is my code:Entire traceback: