SelectMenu icon indicating copy to clipboard operation
SelectMenu copied to clipboard

ImportError: cannot import name 'Token' from 'prompt_toolkit.token' (/usr/lib/python3/dist-packages/prompt_toolkit/token.py)

Open sevku opened this issue 4 years ago • 5 comments

$ pip3 install SelectMenu
Collecting SelectMenu
  Using cached SelectMenu-1.0.0b2.tar.gz (3.4 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2e5v4gfb/SelectMenu/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2e5v4gfb/SelectMenu/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-2e5v4gfb/SelectMenu/pip-egg-info
         cwd: /tmp/pip-install-2e5v4gfb/SelectMenu/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-2e5v4gfb/SelectMenu/setup.py", line 5, in <module>
        from selectmenu import __author__, __version__
      File "/tmp/pip-install-2e5v4gfb/SelectMenu/selectmenu/__init__.py", line 4, in <module>
        from selectmenu.core import SelectMenu
      File "/tmp/pip-install-2e5v4gfb/SelectMenu/selectmenu/core.py", line 6, in <module>
        from prompt_toolkit.token import Token
    ImportError: cannot import name 'Token' from 'prompt_toolkit.token' (/usr/lib/python3/dist-packages/prompt_toolkit/token.py)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

sevku avatar Feb 04 '21 16:02 sevku

@sevku

I'm sorry, selectMenu doesn't support python3.

alice1017 avatar Feb 05 '21 00:02 alice1017

Thanks for your reply. I'm aware of that.

I got it to run on Python3 with downgrading prompt_toolkit to 1.0.14

pip install 'prompt_toolkit==1.0.14

This is not a permanent solution, but it shows that there is basically only one issue to be solved to make it compatible with Python 3.

Then again I see that's a pretty essential part. I might play around with it.

sevku avatar Feb 05 '21 07:02 sevku

Yes I got it running too with that solution too

rickerp avatar Mar 20 '21 17:03 rickerp

@sevku I'm sorry, selectMenu doesn't support python3.

Please Update selectmenu that supports python 3

Sorry I can't do that. I have no time and don't have the use for it.

sevku avatar Nov 18 '21 14:11 sevku

just install prompt toolkit version 1.0.14 by typing : pip install prompt_toolkit==1.0.14 it will be solved

Cyberlight-official avatar May 19 '23 18:05 Cyberlight-official