Datalux / Osintgram

Osintgram is a OSINT tool on Instagram. It offers an interactive shell to perform analysis on Instagram account of any users by its nickname
GNU General Public License v3.0
9.76k stars 2.16k forks source link

AttributeError: module 'collections' has no attribute 'Callable' #515

Closed ReimuHakureii closed 2 years ago

ReimuHakureii commented 2 years ago

(venv) PS C:\Users\TheTwins\Desktop\Osintgram> python main.py Traceback (most recent call last): File "C:\Users\TheTwins\Desktop\Osintgram\main.py", line 102, in pyreadline.Readline().parse_and_bind("tab: complete") File "C:\Users\TheTwins\Desktop\Osintgram\venv\lib\site-packages\pyreadline\rlmain.py", line 422, in init BaseReadline.init(self) File "C:\Users\TheTwins\Desktop\Osintgram\venv\lib\site-packages\pyreadline\rlmain.py", line 62, in init mode.init_editing_mode(None) File "C:\Users\TheTwins\Desktop\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\TheTwins\Desktop\Osintgram\venv\lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key if not callable(func): File "C:\Users\TheTwins\Desktop\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'

JeelRajodiya commented 2 years ago

@Hatomi-Ciqada It is occurring because you are using python 3.10.

Solution 1: Roll back to python 3.9

Solution 2: open C:\Users\TheTwins\Desktop\Osintgram\venv\lib\site-packages\pyreadline\py3k_compat.py file then add two new lines below import collections statement:

import collections.abc  
collections.Callable = collections.abc.Callable

Whole file will look like this:

from __future__ import print_function, unicode_literals, absolute_import
import sys

if sys.version_info[0] >= 3:
    import collections
    import collections.abc
    collections.Callable = collections.abc.Callable
    PY3 = True
    def callable(x):
        return isinstance(x, collections.Callable)

    def execfile(fname, glob, loc=None):
        loc = loc if (loc is not None) else glob
        with open(fname) as fil:
            txt = fil.read()
        exec(compile(txt, fname, 'exec'), glob, loc)

    unicode = str
    bytes = bytes
    from io import StringIO
else:
    PY3 = False
    callable = callable
    execfile = execfile
    bytes = str
    unicode = unicode

    from StringIO import StringIO
OhamsEmeka commented 2 years ago

@Hatomi-Ciqada It is occurring because you are using python 3.10.

Solution 1: Roll back to python 3.9

Solution 2: open C:\Users\TheTwins\Desktop\Osintgram\venv\lib\site-packages\pyreadline\py3k_compat.py file then add two new lines below import collections statement:

import collections.abc  
collections.Callable = collections.abc.Callable

Whole file will look like this:

from __future__ import print_function, unicode_literals, absolute_import
import sys

if sys.version_info[0] >= 3:
    import collections
    import collections.abc
    collections.Callable = collections.abc.Callable
    PY3 = True
    def callable(x):
        return isinstance(x, collections.Callable)

    def execfile(fname, glob, loc=None):
        loc = loc if (loc is not None) else glob
        with open(fname) as fil:
            txt = fil.read()
        exec(compile(txt, fname, 'exec'), glob, loc)

    unicode = str
    bytes = bytes
    from io import StringIO
else:
    PY3 = False
    callable = callable
    execfile = execfile
    bytes = str
    unicode = unicode

    from StringIO import StringIO

i did what you said but, when i run the script nothing happens no error

ReimuHakureii commented 2 years ago

@jeel2331 Thank you for the help, solution 1 seems to have fixed it. It seems that a function was deprecated with python updating.

OhamsEmeka commented 2 years ago

@jeel2331 Thank you for the help, solution 1 seems to have fixed it. It seems that a function was deprecated with python updating.

It didn't fix it for me sadly, are you doing it on windows ???

JeelRajodiya commented 2 years ago

@jeel2331 Thank you for the help, solution 1 seems to have fixed it. It seems that a function was deprecated with python updating.

It didn't fix it for me sadly, are you doing it on windows ???

yes

ReimuHakureii commented 2 years ago

@jeel2331 Thank you for the help, solution 1 seems to have fixed it. It seems that a function was deprecated with python updating.

It didn't fix it for me sadly, are you doing it on windows ??? I am using windows, if you're using solution 1 it works on both Linux and Windows I tested it. If you're using solution 2 the same applies. So I don't know what you're doing wrong. Could you please precise.

OhamsEmeka commented 2 years ago

@jeel2331 Thank you for the help, solution 1 seems to have fixed it. It seems that a function was deprecated with python updating.

It didn't fix it for me sadly, are you doing it on windows ??? I am using windows, if you're using solution 1 it works on both Linux and Windows I tested it. If you're using solution 2 the same applies. So I don't know what you're doing wrong. Could you please precise.

i tried solution 2, nothing was happening so i gave up, i might try solution 2 and see how that goes