IDAPython (IDA Pro Python SDK)
raw JSON → 0.0.8 verified Fri May 01 auth: no python
IDAPython is the official Python SDK for Hex-Rays IDA Pro disassembler. This PyPI package (version 0.0.8) provides the `idapython` module that allows loading and executing IDA scripts from outside IDA. It is a thin wrapper that communicates with a running IDA instance via IPC. Note that the standard IDAPython API (ida_*, idc, idautils) is only available inside IDA's embedded Python, not from this external package. Use for automation, script launching, and headless analysis.
pip install idapro Common errors
error ModuleNotFoundError: No module named 'idapython' ↓
cause Trying to import 'idapython' directly, but it is a submodule of 'idapro'.
fix
Use 'from idapro import idapython' or 'import idapro' then 'idapro.idapython'
error idapro.IDAProException: No response from IDA (timeout) ↓
cause IDA Pro is not running, or the IDAPython plugin is not loaded, or the communication port is not open.
fix
Ensure IDA Pro is running with a database open. Check IDA's output window for errors. Restart IDA and try again.
error ImportError: No module named 'idaapi' ↓
cause Attempting to import standard IDAPython modules (idaapi, idc, idautils) outside of IDA's embedded Python environment.
fix
These modules are only available inside IDA. Use 'idapro.execute()' to run scripts that import 'idaapi' inside IDA.
error AttributeError: module 'idapro' has no attribute 'IDAPython' ↓
cause Outdated version of idapro (<0.0.8) or using an older API where the class was named differently.
fix
Update idapro: 'pip install --upgrade idapro'. Ensure you have version 0.0.8 or later.
Warnings
breaking The 'idapro' package (PyPI version 0.0.8) is NOT the standard IDAPython SDK. The standard IDA Python modules (ida_*, idc, idautils) are NOT available via 'import idapro'. They are only available inside IDA's embedded Python interpreter. ↓
fix Use 'import idapro' only for the external wrapper. For standard IDAPython scripting, work inside IDA or use IDA's built-in Python environment.
gotcha When using idapro.IDAPython(), ensure IDA Pro is already running and the IDAPython plugin is loaded. The connection may fail silently or with unclear errors if IDA is not ready. ↓
fix Start IDA Pro and open a database before running scripts that use 'idapro'.
deprecated Some older examples use 'idapython.IDAPython()' directly. This is no longer correct; you must import via 'from idapro import idapython' or use 'import idapro' and then 'idapro.IDAPython()'. ↓
fix Use 'from idapro import idapython' or simply 'import idapro' and call 'idapro.IDAPython()'.
gotcha The 'execute' method runs code synchronously. For long-running scripts, use 'exec_async' (if available) or spawn a thread. The default timeout may cause script to hang. ↓
fix For non-blocking execution, check if 'ida.exec_async' is available or run code that completes quickly.
Imports
- idapro
import idapro - idapython wrong
import idapythoncorrectfrom idapro import idapython - idaapi wrong
import idaapi # outside IDAcorrectimport idaapi # only inside IDA's embedded Python
Quickstart
import idapro
ida = idapro.IDAPython()
ida.execute("print('Hello from IDA')")
ida.close()