Installing angr

angr is a library for Python 3.8+, and must be installed into a Python environment before it can be used.

Installing from PyPI

angr is published on PyPI, and using this is the easiest and recommended way to install angr. It can be installed angr with pip:

pip install angr

Tip

It is recommended to use an isolated python environment rather than installing angr globally. Doing so reduces dependency conflicts and aids in reproducibility while debugging. Some popular tools that accomplish this include:

Note

The PyPI distribution includes binary packages for most popular system configurations. If you are using a system that is not supported by the binary packages, you will need to build the C dependencies from source. See the Installing from Source section for more information.

Installing from Source

angr is a collection of Python packages, each of which is published on GitHub. The easiest way to install angr from source is to use angr-dev.

To set up a development environment manually, first ensure that build dependencies are installed. These consist of python development headers, make, and a C compiler. On Ubuntu, these can be installed with:

sudo apt-get install python3-dev build-essential

Then, checkout and install the following packages, in order:

Installing with Docker

The angr team maintains a container image on Docker Hub that includes angr and its dependencies. This image can be pulled with:

docker pull angr/angr

The image can be run with:

docker run -it angr/angr

This will start a shell in the container, with angr installed and ready to use.

Troubleshooting

angr has no attribute Project, or similar

If angr can be imported but the Project class is missing, it is likely one of two problems:

  1. There is a script named angr.py in the working directory. Rename it to something else.

  2. There is a folder called angr in your working directory, possibly the cloned repository. Change the working directory to somewhere else.

AttributeError: ‘module’ object has no attribute ‘KS_ARCH_X86’

The keystone package is installed, which conflicts with the keystone-engine package, an optional dependency of angr. Uninstall keystone and install keystone-engine.