Ghidra Downloadindependent download & install guide
English
PYTHON AUTOMATION

PyGhidra Install and Quick Start Guide

PyGhidra connects native CPython 3 to the Ghidra API. This guide covers supported versions, safe installation, configuration, a first script, workflow choices, and troubleshooting.

PyGhidra on PyPI
PyGhidra3.1.0
Ghidra12.0+
Python3.9+
Verified2026-07-22
PYGHIDRA

What PyGhidra is

PyGhidra is the official Python library and Ghidra integration for using the Ghidra API from native CPython 3. It exposes projects, programs, symbols, listings, analysis services and scripts to ordinary Python workflows.

PyGhidra is the official Python library and Ghidra integration for using the Ghidra API from native CPython 3. It exposes projects, programs, symbols, listings, analysis services and scripts to ordinary Python workflows. See the official sources and keep the environment reproducible.

PYGHIDRA

Requirements and verified versions

The current PyPI package is PyGhidra 3.1.0, uploaded May 14, 2026. It requires Python 3.9 or later and Ghidra 12.0 or later. This site verified Ghidra 12.1.2 and JDK 21 as the current compatible setup.

The current PyPI package is PyGhidra 3.1.0, uploaded May 14, 2026. It requires Python 3.9 or later and Ghidra 12.0 or later. This site verified Ghidra 12.1.2 and JDK 21 as the current compatible setup. See the official sources and keep the environment reproducible.

PYGHIDRA

How to install PyGhidra

Use a dedicated virtual environment. Online installation uses PyPI; offline installation uses the package bundle inside the official Ghidra distribution. Do not download an unknown EXE described as a PyGhidra installer.

Use a dedicated virtual environment. Online installation uses PyPI; offline installation uses the package bundle inside the official Ghidra distribution. Do not download an unknown EXE described as a PyGhidra installer. See the official sources and keep the environment reproducible.

  1. 1

    Virtual environment

    Isolate dependencies.

    python -m venv .venv
  2. 2

    Install

    Use the active interpreter.

    python -m pip install --upgrade pyghidra==3.1.0
  3. 3

    Offline option

    Use the official bundled package.

    python -m pip install --no-index -f <GhidraInstallDir>/Ghidra/Features/PyGhidra/pypkg/dist pyghidra
PYGHIDRA

Connect PyGhidra to Ghidra

Set GHIDRA_INSTALL_DIR to the extracted Ghidra root, or pass install_dir to pyghidra.start(). Pin the path when several Ghidra versions are installed side by side.

Set GHIDRA_INSTALL_DIR to the extracted Ghidra root, or pass install_dir to pyghidra.start(). Pin the path when several Ghidra versions are installed side by side. See the official sources and keep the environment reproducible.

Ghidra pathGHIDRA_INSTALL_DIR=<path-to-ghidra-root>
PyGhidra Install and Quick Start Guide
Connect PyGhidra to Ghidra
PYGHIDRA

Run a first automation

Start Ghidra once per Python process, open an authorized disposable sample, handle resources with a context manager, and write results outside the application directory.

Start Ghidra once per Python process, open an authorized disposable sample, handle resources with a context manager, and write results outside the application directory. See the official sources and keep the environment reproducible.

Minimal examplefrom pathlib import Path import pyghidra with pyghidra.open_program(Path('sample.exe')) as api: print(api.getCurrentProgram().getName())
Run a first automation
Run a first automation
PYGHIDRA

Common PyGhidra problems

Most failures come from the wrong Python environment, an unsupported Java runtime, an incorrect Ghidra root, or a version mismatch. Treat binaries and third-party scripts as untrusted input.

Most failures come from the wrong Python environment, an unsupported Java runtime, an incorrect Ghidra root, or a version mismatch. Treat binaries and third-party scripts as untrusted input. See the official sources and keep the environment reproducible.

SymptomCauseCheck
Import errorWrong environmentpython -m pip show pyghidra
Java errorWrong JDKjava -version
Path errorWrong rootGHIDRA_INSTALL_DIR
API mismatchVersion boundaryPyGhidra 3.x + Ghidra 12.0+
FAQ

PyGhidra FAQ

Is PyGhidra included with Ghidra?

PyGhidra is the official Python library and Ghidra integration for using the Ghidra API from native CPython 3. It exposes projects, programs, symbols, listings, analysis services and scripts to ordinary Python workflows.

Which Python version is required?

Python 3.9 or later.

Why can it not find Ghidra?

Set GHIDRA_INSTALL_DIR to the extracted Ghidra root, or pass install_dir to pyghidra.start(). Pin the path when several Ghidra versions are installed side by side.

Does it replace analyzeHeadless?

No. Choose the workflow that fits the pipeline.

Is PyGhidra MCP the same project?

No. MCP tools are separate projects.