# How to build Ansible?

**URL:** <https://forum.ansible.com/t/how-to-build-ansible/30220>\
**Category:** Ansible Project\
**Created:** [April 30, 2019, 6:07am UTC](https://forum.ansible.com/t/how-to-build-ansible/30220 "2019-04-30T06:07:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Matthew\_Davis](https://forum.ansible.com/u/Matthew_Davis)\
**Post date:** [April 30, 2019, 6:07am UTC](https://forum.ansible.com/t/how-to-build-ansible/30220/1 "2019-04-30T06:07:08Z")

</div>

I asked this in [github issue #55900](https://github.com/ansible/ansible/issues/55900) but got directed here.

I want to contribute to Ansible.

I have a patch I want to submit. But first I need to run it to make sure it actually works.

How can I run Ansible from source?

The github README and the [Contributing to Ansible](https://docs.ansible.com/ansible/latest/community/how_can_I_help.html#review-and-submit-pull-requests) doc pages do not explain how.

What I tried:

I looked in `README.rst`, but there are no instructions there.

I see a `Makefile`, and no `config.sh` or `autoconfig.sh`. So I try just `make`.

```auto
ImportError: No module named **packaging.version**

```

I see `requirements.txt`. There is no comment in there or anywhere else telling me whether that’s for python 2 or 3.

```auto
virtualenv env -p $(which python3)
. ./env/bin/activate
pip install -r requirements.txt
make

```

Same error

```auto
pip install packaging
make

```

Now that does build. But why is `packaging` not in `requirements.txt`?

Then I try to find where the build output is.

```auto
$ find ./ -name ansible | xargs file
./build/lib/ansible: directory
./build/scripts-3.6/ansible: Python script, ASCII text executable
./bin/ansible: Python script, ASCII text executable
./docs/docsite/js/ansible: directory
./lib/ansible: directory
./packaging/macports/sysutils/ansible: directory
./packaging/port/sysutils/ansible: directory
./test/integration/targets/ansible: directory
./test/runner/injector/ansible: symbolic link to python.py

```

Then `./bin/ansible --version`. That fails with `ModuleNotFoundError: No module named 'ansible'`

Same with `./build/scripts-3.6/ansible --version`.

I want to contribute, but I just can’t figure out how.

- What dependencies do I need?
- python 2 or 3?
- do I need to run `setup.py` or something to install the output of the build process into a virtualenv in order to actually test it?

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![Matthew\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Matthew\_Davis](https://forum.ansible.com/u/Matthew_Davis)\
**Post date:** [April 30, 2019, 7:34am UTC](https://forum.ansible.com/t/how-to-build-ansible/30220/2 "2019-04-30T07:34:32Z")

</div>

Ah, I ended up getting a reply on that github thread.

The answer is here: [https://docs.ansible.com/ansible/latest/installation\_guide/intro\_installation.html#running-from-source](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#running-from-source)

I have submitted [PR #55902](https://github.com/ansible/ansible/pull/55902) to add that link to the README.

Regards,  
Matt
