Closed Travelling-Human closed 3 months ago
@Travelling-Human The error you’re encountering occurs because the Mapping class has been moved from collections to collections.abc in Python 3.10 and later versions. This change breaks compatibility with older code that imports Mapping directly from collections.
To fix this issue, you need to modify the import statement in the from_dict.py file of the prompt_toolkit package. Here are the steps to resolve this issue:
Locate the from_dict.py file in your prompt_toolkit package directory. Based on your traceback, the path should be something like:
/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/styles/from_dict.py
Open the from_dict.py file in a text editor.
Find the line that imports Mapping:
from collections import Mapping
Change this line to import Mapping from collections.abc:
from collections.abc import Mapping
Thank you for the response
Traceback (most recent call last): File "/data/data/com.termux/files/usr/bin/xosint", line 21, in
from prompt_toolkit import print_formatted_text, HTML
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/init.py", line 16, in
from .interface import CommandLineInterface
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/interface.py", line 19, in
from .application import Application, AbortAction
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/application.py", line 8, in
from .key_binding.bindings.basic import load_basic_bindings
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in
from prompt_toolkit.renderer import HeightIsUnknownError
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/renderer.py", line 11, in
from prompt_toolkit.styles import Style
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/styles/init.py", line 8, in
from .from_dict import *
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/data/data/com.termux/files/usr/lib/python3.11/collections/init.py)
This is what I got when I tried to run x-osint in termux. What is the problem here?