pythonubuntuandroguard

Cannot import androguard in python ubuntu 16.04


I have installed the latest androguard in my ubuntu 16.04 LTS os using (apt install androguard). I can get into the shell using "androlyze -s" command. But I cannot import androguard into my python code. For example when I run the test.py file using "python test.py" command from terminal I get the error:

Traceback (most recent call last):
File "test.py", line 1, in <module>
from androguard.core.bytecodes import apk
ImportError: No module named androguard.core.bytecodes

Bellow is my python code:

from androguard.core.bytecodes import apk

a = apk.APK("/path/to/apk/apk_name.apk")
pk_name = a.get_package()
act_name = a.get_main_activity()
final_arg = pk_name+"/"+act_name
print(final_arg)

Solution

  • (apt install androguard) is for debian hence it wasn't working. I had to install it from the sources. How to install it from the sources can be found in the following link:

    Androguard Doc