Cannot type anything on odrivetool and error persist on python

I can run the odrivetool however, when I try to type a single character, an error persists.
Please see the error code below:
Odrive: V3.6 56V
Firmware: v0.6.3
OS: Ubuntu 20.04 LTS Focal Fossa
Python version: 3.8.6

Unhandled exception in event loop:
File “/usr/lib/python3.8/asyncio/events.py”, line 81, in _run
self._context.run(self._callback, *self._args)
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/application/application.py”, line 698, in read_from_input
self.key_processor.process_keys()
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/key_binding/key_processor.py”, line 272, in process_keys
self._process_coroutine.send(key_press)
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/key_binding/key_processor.py”, line 170, in _process
matches = self._get_matches(buffer)
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/key_binding/key_processor.py”, line 128, in _get_matches
return [b for b in self._bindings.get_bindings_for_keys(keys) if b.filter()]
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/key_binding/key_processor.py”, line 128, in
return [b for b in self._bindings.get_bindings_for_keys(keys) if b.filter()]
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/filters/base.py”, line 134, in call
return all(f() for f in self.filters)
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/filters/base.py”, line 134, in
return all(f() for f in self.filters)
File “/usr/local/lib/python3.8/dist-packages/prompt_toolkit/filters/base.py”, line 248, in call
return self.func()
File “/usr/local/lib/python3.8/dist-packages/IPython/terminal/shortcuts/filters.py”, line 162, in readline_like_completions
return shell.display_completions == “readlinelike”

Exception ‘NoneType’ object has no attribute ‘display_completions’
Press ENTER to continue…

I managed to solve it by downgrading ipython: pip install ipython==8.0.1
Similar problem is described here: IPython 8.1.0 claims to be compatible with Python 3.8, but isn't · Issue #13554 · ipython/ipython · GitHub

2 Likes

In case it helps anyone else…

Unhandled exception in event loop:
  File "/usr/lib64/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/application/application.py", line 698, in read_from_input
    self.key_processor.process_keys()
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 272, in process_keys
    self._process_coroutine.send(key_press)
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 170, in _process
    matches = self._get_matches(buffer)
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 128, in _get_matches
    return [b for b in self._bindings.get_bindings_for_keys(keys) if b.filter()]
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/key_binding/key_processor.py", line 128, in <listcomp>
    return [b for b in self._bindings.get_bindings_for_keys(keys) if b.filter()]
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/filters/base.py", line 134, in __call__
    return all(f() for f in self.filters)
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/filters/base.py", line 134, in <genexpr>
    return all(f() for f in self.filters)
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/prompt_toolkit/filters/base.py", line 248, in __call__
    return self.func()
  File "/home/samitbasu/Devel/odrive/.venv/lib64/python3.10/site-packages/IPython/terminal/shortcuts/filters.py", line 162, in readline_like_completions
    return shell.display_completions == "readlinelike"

Exception 'NoneType' object has no attribute 'display_completions'

I resolved the issue by changing the beginning of the odrivetool python script from

#!/home/samitbasu/Devel/odrive/.venv/bin/python3

to:

#!/home/samitbasu/Devel/odrive/.venv/bin/ipython3

(note the i in the python executable). This made the tool CLI happy. Ideally, this should be fixed upstream unless there is something wrong with my particular Python setup (which is entirely possible). I am using Python 3.10.10 on Fedora 36.

thanks much it works