Monday, January 03, 2022

Windows 11 / Python 3.10 / rshell error: module 'collections' has no attribute 'Callable'

You want to edit file py3k_compat.py - depending on where you installed Python, this path will vary:

c:\python\lib\site-packages\pyreadline\py3k_compat.py

or (if installed for all users),

C:\Program Files\Python310\Lib\site-packages\pyreadline\py3k_compat.py

Update line 8 to read (add the .abc. - edit as Administrator if working in Program Files, don't change indentation):

return isinstance(x, collections.abc.Callable)

Reference:

https://www.mfitzp.com/tutorials/using-micropython-raspberry-pico/

https://github.com/hylang/hy/issues/2114