Skip to content

Help Needed: pyreadline AttributeError on Python 3.10+ #2600

@ipargatdhillon

Description

@ipargatdhillon

Hi Osintgram developers,

I’m trying to run Osintgram on Windows with Python 3.10+, but I get the following error when starting the interactive shell:

(venv) C:\Users\pc\Osintgram\Osintgram>python main.py username
Traceback (most recent call last):
File "C:\Users\pc\Osintgram\Osintgram\main.py", line 108, in
pyreadline.Readline().parse_and_bind("tab: complete")
~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\pc\Osintgram\Osintgram\venv\Lib\site-packages\pyreadline\rlmain.py", line 422, in init
BaseReadline.init(self)
~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\pc\Osintgram\Osintgram\venv\Lib\site-packages\pyreadline\rlmain.py", line 62, in init
mode.init_editing_mode(None)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\pc\Osintgram\Osintgram\venv\Lib\site-packages\pyreadline\modes\emacs.py", line 633, in init_editing_mode
self._bind_key('space', self.self_insert)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\pc\Osintgram\Osintgram\venv\Lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key
if not callable(func):
~~~~~~~~^^^^^^
File "C:\Users\pc\Osintgram\Osintgram\venv\Lib\site-packages\pyreadline\py3k_compat.py", line 8, in callable
return isinstance(x, collections.Callable)
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Callable'

It seems the error is caused by collections.Callable being removed in Python 3.10+.

Could you advise the best way to fix this so I can run Osintgram without downgrading Python?
Is there a recommended patched version of pyreadline or should I modify the code manually?

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions