MobileLLM / AutoDroid

Source code for the paper "Empowering LLM to use Smartphone for Intelligent Task Automation"
https://arxiv.org/abs/2308.15272
MIT License
269 stars 34 forks source link

ModuleNotFoundError: No module named 'androguard.core.apk' #19

Closed IcyFeather233 closed 1 month ago

IcyFeather233 commented 1 month ago

Env

pip list:

Package               Version     Editable project location
--------------------- ----------- -------------------------
alembic               1.13.3
androguard            3.4.0a1
annotated-types       0.7.0
anyio                 4.5.2
apkInspector          1.3.2
asn1crypto            1.5.1
asttokens             2.4.1
backcall              0.2.0
banal                 1.0.6
certifi               2024.8.30
charset-normalizer    3.4.0
click                 8.1.7
colorama              0.4.6
contourpy             1.1.1
cycler                0.12.1
dataset               1.6.2
decorator             5.1.1
distro                1.9.0
droidbot              1.0.2b4     d:\project\autodroid
exceptiongroup        1.2.2
executing             2.1.0
filelock              3.16.1
fonttools             4.54.1
frida                 16.5.6
fsspec                2024.9.0
greenlet              3.1.1
h11                   0.14.0
httpcore              1.0.6
httpx                 0.27.2
huggingface-hub       0.25.2
idna                  3.10
importlib_metadata    8.5.0
importlib_resources   6.4.5
InstructorEmbedding   1.0.1
ipython               8.12.3
jedi                  0.19.1
Jinja2                3.1.4
jiter                 0.6.1
joblib                1.4.2
jsonpickle            3.3.0
kiwisolver            1.4.7
loguru                0.7.2
lxml                  5.3.0
Mako                  1.3.5
MarkupSafe            2.1.5
matplotlib            3.7.5
matplotlib-inline     0.1.7
mpmath                1.3.0
mutf8                 1.0.6
networkx              3.1
numpy                 1.24.4
openai                1.51.2
packaging             24.1
parso                 0.8.4
pickleshare           0.7.5
pillow                10.4.0
pip                   24.2
prompt_toolkit        3.0.48
pure_eval             0.2.3
pydantic              2.9.2
pydantic_core         2.23.4
pydot                 3.0.2
Pygments              2.18.0
pyparsing             3.1.4
pytesseract           0.3.13
python-dateutil       2.9.0.post0
pyvis                 0.3.2
PyYAML                6.0.2
regex                 2024.9.11
requests              2.32.3
safetensors           0.4.5
scikit-learn          1.3.2
scipy                 1.10.1
sentence-transformers 3.2.0
setuptools            75.1.0
six                   1.16.0
sniffio               1.3.1
SQLAlchemy            1.4.54
stack-data            0.6.3
sympy                 1.13.3
threadpoolctl         3.5.0
tokenizers            0.20.1
torch                 2.4.1
tqdm                  4.66.5
traitlets             5.14.3
transformers          4.45.2
treelib               1.7.0
typing_extensions     4.12.2
urllib3               2.2.3
wcwidth               0.2.13
wheel                 0.44.0
win32-setctime        1.1.0
zipp                  3.20.2

python version: 3.8

OS: Windows 10

Command

droidbot -a .\apk\org.totschnig.myexpenses_759.apk -o output_dir 
-task "create a record" -keep_env -keep_app

Output

Traceback (most recent call last):
  File "d:\project\autodroid\droidbot\droidbot.py", line 98, in __init__
    self.app = App(app_path, output_dir=self.output_dir)
  File "d:\project\autodroid\droidbot\app.py", line 29, in __init__     
    from androguard.core.apk import APK
ModuleNotFoundError: No module named 'androguard.core.apk'
[CONNECTION] ADB is disconnected
error: closed
Traceback (most recent call last):
  File "d:\project\autodroid\droidbot\droidbot.py", line 98, in __init__
    self.app = App(app_path, output_dir=self.output_dir)
  File "d:\project\autodroid\droidbot\app.py", line 29, in __init__
    from androguard.core.apk import APK
ModuleNotFoundError: No module named 'androguard.core.apk'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\\?\C:\Users\IcyFeather\AppData\Local\anaconda3\envs\droidbot\Scripts\droidbot-script.py", line 33, in <module>
    sys.exit(load_entry_point('droidbot', 'console_scripts', 'droidbot')())
  File "d:\project\autodroid\start.py", line 66, in main
    droidbot = DroidBot(
  File "d:\project\autodroid\droidbot\droidbot.py", line 119, in __init__
    self.stop()
  File "d:\project\autodroid\droidbot\droidbot.py", line 189, in stop
    self.device.disconnect()
  File "d:\project\autodroid\droidbot\device.py", line 176, in disconnect
    adapter.disconnect()
  File "d:\project\autodroid\droidbot\adapter\droidbot_ime.py", line 76, in disconnect
    r_disable = self.device.adb.shell("ime disable %s" % IME_SERVICE)
  File "d:\project\autodroid\droidbot\adapter\adb.py", line 89, in shell
    return self.run_cmd(shell_extra_args)
  File "d:\project\autodroid\droidbot\adapter\adb.py", line 68, in run_cmd
    r = subprocess.check_output(args).strip()
  File "C:\Users\IcyFeather\AppData\Local\anaconda3\envs\droidbot\lib\subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\IcyFeather\AppData\Local\anaconda3\envs\droidbot\lib\subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['adb', '-s', '127.0.0.1:5555', 'shell', 'ime', 'disable', 'io.github.ylimit.droidbotapp/.DroidBotIME']' returned non-zero exit status 1.
zr4in commented 1 month ago

If this helps. https://github.com/honeynet/droidbot/pull/160/commits/91ecfc7f09326cf7bacbd014c2f6fb1cb4b605d3

IcyFeather233 commented 1 month ago

This works. Thanks so much