ImportError: cannot import name 'Token'
See original GitHub issueGetting following error:
Traceback (most recent call last): File "Main.py", line 2, in <module> from PyInquirer import prompt, print_json File "C:\Users\CBAY\OneDrive - Netcompany\Python Projects\TimeRegistration\venv\lib\site-packages\PyInquirer\__init__.py", line 6, in <module> from prompt_toolkit.token import Token ImportError: cannot import name 'Token'
Running on Windows 10 Enterprise both in Powershell and Cmder. Same error.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Python cannot import 'Token' from 'token' - Stack Overflow
I'm trying to make a lexer in python but when I try to import a class from file token.
Read more >Issue 46324: 'import traceback' Causes a Crash - Python tracker
I was developing a programming language using Python, and I had a 'token.py' file. After changing the name of the file, the issue...
Read more >eth-brownie/community - Gitter
ImportError : cannot import name 'Token' from 'brownie' (/home/ajit-soman/.local/pipx/venvs/eth-brownie/lib/python3.8/site-packages/brownie/init.py).
Read more >from brownie import Token, accounts
Exception has occurred : ImportError cannot import name 'Token' from ' ... but they assume you have a Token contract defined. brownie bake ......
Read more >cannot import name '_sanitize_token' from django - Reddit
The culprit seems to be this commit that renamed the function the ImportError is complaining about. Try downgrading django.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got the same issue. A walkaround is to downgrade the prompt_toolkit and it worked for me. pip install ‘prompt_toolkit==1.0.14’
Maybe better change the version of prompt_toolkit in requirements.txt: prompt_toolkit==1.0.14
Otherwise will always use latest version of prompt_toolkit FYI: There is breaking update in prompt_toolkit 2.0
pip install ‘prompt_toolkit==1.0.14’
Unfortunately this now makes
ipython 7.12.0
not work.when trying to use
ipython
it gives the following error:after
pip install prompt_toolkit
ipython now works again but pyinquirer fails