[GH-ISSUE #32] ImportError: cannot import name 'Token' from 'prompt_toolkit.token' #19

Closed
opened 2026-02-22 18:17:28 -05:00 by yindo · 1 comment
Owner

Originally created by @rahiminabdulamin on GitHub (Jun 11, 2023).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/32

After getting yarn setup successfully (after a lot of troubleshooting by installing missing dependencies and other things), here is an error I got when proceeding to run python main.py from collector folder:

(my-venv) PS C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\collector> python main.py
Traceback (most recent call last):
  File "C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\collector\main.py", line 2, in <module>
    from whaaaaat import prompt, Separator
  File "C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\my-venv\lib\site-packages\whaaaaat\__init__.py", line 6, in <module>
    from prompt_toolkit.token import Token
ImportError: cannot import name 'Token' from 'prompt_toolkit.token' (C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\my-venv\lib\site-packages\prompt_toolkit\token.py)

When I opened up the token.py script mentioned in the error, this is what it looks like for me:

"""
"""

from __future__ import annotations

__all__ = [
    "ZeroWidthEscape",
]

ZeroWidthEscape = "[ZeroWidthEscape]"

I'm stumped by this stage and can't self-troubleshoot any further. I'm running on Windows 10. Please help. Any ideas to resolve this?

Originally created by @rahiminabdulamin on GitHub (Jun 11, 2023). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/32 After getting `yarn setup` successfully (after a lot of troubleshooting by installing missing dependencies and other things), here is an error I got when proceeding to run `python main.py` from collector folder: ``` (my-venv) PS C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\collector> python main.py Traceback (most recent call last): File "C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\collector\main.py", line 2, in <module> from whaaaaat import prompt, Separator File "C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\my-venv\lib\site-packages\whaaaaat\__init__.py", line 6, in <module> from prompt_toolkit.token import Token ImportError: cannot import name 'Token' from 'prompt_toolkit.token' (C:\Users\rahim\OneDrive\Desktop\TEST\anything-llm\my-venv\lib\site-packages\prompt_toolkit\token.py) ``` When I opened up the token.py script mentioned in the error, this is what it looks like for me: ``` """ """ from __future__ import annotations __all__ = [ "ZeroWidthEscape", ] ZeroWidthEscape = "[ZeroWidthEscape]" ``` I'm stumped by this stage and can't self-troubleshoot any further. I'm running on Windows 10. Please help. Any ideas to resolve this?
yindo closed this issue 2026-02-22 18:17:28 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jun 12, 2023):

Closing this as a duplicate. This is because of a dependency that wont install on windows. Will have a dockerized version live soon and you can run it then on any OS!

see #34

@timothycarambat commented on GitHub (Jun 12, 2023): Closing this as a duplicate. This is because of a dependency that wont install on windows. Will have a dockerized version live soon and you can run it then on any OS! see #34
yindo changed title from ImportError: cannot import name 'Token' from 'prompt_toolkit.token' to [GH-ISSUE #32] ImportError: cannot import name 'Token' from 'prompt_toolkit.token' 2026-06-05 14:33:02 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#19