# Ansible - install python3-apt package

**URL:** <https://forum.ansible.com/t/ansible-install-python3-apt-package/33719>\
**Category:** Ansible Developer\
**Tags:** ubuntu\
**Created:** [September 1, 2020, 9:34pm UTC](https://forum.ansible.com/t/ansible-install-python3-apt-package/33719 "2020-09-01T21:34:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamB](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@SamB](https://forum.ansible.com/u/SamB)\
**Post date:** [September 1, 2020, 9:34pm UTC](https://forum.ansible.com/t/ansible-install-python3-apt-package/33719/1 "2020-09-01T21:34:03Z")

</div>

I am Using Ubuntu 18.04, Ansible 2.9, Python 3.6.9, have installed python3-apt

On a basic ansible command ansible -b all -m apt -a “name=apache2 state=latest” **Get Error:**

FAILED! =\> { “ansible\_facts”: { “discovered\_interpreter\_python”: “/usr/bin/python” }, “changed”: false, “msg”: “Could not import python modules: apt, apt\_pkg. **Please install python3-apt package.** ”

_Don’t know if it is asking for this package on my Server machine or Node m/c - I have installed it on both._

**$ sudo apt-get install python3-apt**

**$ ansible --version**  
ansible 2.9.12  
python version = 3.6.9

**$ python --version**  
Python 3.7.6

Any ideas?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [September 1, 2020, 9:41pm UTC](https://forum.ansible.com/t/ansible-install-python3-apt-package/33719/2 "2020-09-01T21:41:52Z")

</div>

`python3-apt` needs to be installed on the target host, where you are trying to install the apache2 package.

---

<div class="post-metadata">

**Author:** ![SamB](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@SamB](https://forum.ansible.com/u/SamB)\
**Post date:** [September 2, 2020, 3:45am UTC](https://forum.ansible.com/t/ansible-install-python3-apt-package/33719/3 "2020-09-02T03:45:32Z")

</div>

As mentioned I have `python3-apt` installed **on both** my Ansible Server (_is it required on the Server?_) and Ansible Node.  
My node also has python 3.7.6
