# dateutil required for this module

**URL:** <https://forum.ansible.com/t/dateutil-required-for-this-module/36306>\
**Category:** Ansible Project\
**Created:** [February 8, 2022, 8:43pm UTC](https://forum.ansible.com/t/dateutil-required-for-this-module/36306 "2022-02-08T20:43:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Bourne](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Jason\_Bourne](https://forum.ansible.com/u/Jason_Bourne)\
**Post date:** [February 8, 2022, 8:43pm UTC](https://forum.ansible.com/t/dateutil-required-for-this-module/36306/1 "2022-02-08T20:43:23Z")

</div>

I guys, I need to some help on this one.  
I create a task to upload some files on an S3 bucket.  
When running the playbook I get the following error:

FAILED! =\> {“changed”: false, “msg”: “dateutil required for this module”}

Now I check if python-dateutil is install in pip and it does. Here is what I have

ansible==2.9  
boto==2.49.0  
boto3==1.9.178  
botocore==1.12.178  
python-dateutil==2.8.2  
python 3.8

This is the task, based on this page [https://docs.ansible.com/ansible/2.9/modules/s3\_sync\_module.html](https://docs.ansible.com/ansible/2.9/modules/s3_sync_module.html)

- name: Sync static folder to S3  
s3\_sync:  
bucket: myS3HomeBuckek  
file\_root: /var/www/project1/.static  
key\_prefix: project/static  
file\_change\_strategy: force  
permission: public-read  
region: us-east-2  
run\_once: yes  
tags: Static

I have tried to uninstall, reinstall with --no-cache-dir and even with --force-reinstall but the  
msg still come back. Has anyone had this issue?

Its an old ansible (v2.9) that I am slowly migrating to the most recent one.

Any help is appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 8, 2022, 10:45pm UTC](https://forum.ansible.com/t/dateutil-required-for-this-module/36306/2 "2022-02-08T22:45:09Z")

</div>

what is the output of:

ansible --version

---

<div class="post-metadata">

**Author:** ![Jason\_Bourne](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Jason\_Bourne](https://forum.ansible.com/u/Jason_Bourne)\
**Post date:** [February 9, 2022, 1:48pm UTC](https://forum.ansible.com/t/dateutil-required-for-this-module/36306/3 "2022-02-09T13:48:01Z")

</div>

Hi Mr Visser  
Thanks for answering

Here is the output

ansible 2.9.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/home/ansible/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /opt/venv/venv\_ansible29/lib/python3.8/site-packages/ansible  
executable location = /opt/venv/venv\_ansible29/bin/ansible  
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]

I realize the path in the “configured module search path” were not there. I created them but not if that is releated.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 10, 2022, 8:54am UTC](https://forum.ansible.com/t/dateutil-required-for-this-module/36306/4 "2022-02-10T08:54:49Z")

</div>

OK that should work.  
What is the exact command that you use to run the playbook?  
What are the outputs of:

which ansible  
which ansible-playbook  
/opt/venv/venv\_ansible29/bin/pip list

As a side note, I see you’re using the 2.9.0 version, which is the very first release of that minor version.  
For instance I couldn’t even run that here as I run into “ERROR! Unexpected Exception, this is probably a bug: cannot pickle ‘module’ object”.  
A first good step in your upgrade would be to start using the latest patch release of 2.9 (which is 2.9.27).

---

<div class="post-metadata">

**Author:** ![Jason\_Bourne](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Jason\_Bourne](https://forum.ansible.com/u/Jason_Bourne)\
**Post date:** [February 14, 2022, 4:07pm UTC](https://forum.ansible.com/t/dateutil-required-for-this-module/36306/5 "2022-02-14T16:07:00Z")

</div>

HI sorry for the delay  
I think I figured out the reason. If thats the case too bad that ansible v 2.8 and 2.9 did not guide me throught this but version 2.10 did. Let me explain.  
I had the same issue with v 2.8 and 2.9, Now I decided to create a new venv with 2.10 and when I ran the playbook it now gave me way more details and from what I see is releated to the fact that Ansible is using the wrong Python interpreter and should be using /usr/bin/python3 while its usr/bin/python. On the server I want to execute the task (through delegate\_to), we had to do at some point a python alternatives to switch from python 2.7 to 3.6. Once I added this variable in my playbook ansible\_python\_interpreter: “/var/virtualenv/bin/python3”, I could connect to the S3 bucket. Now have to fix an ACL permissions to be able to push files in it. That is a temporary fix as we will be migrating all our server to a more recent OS in the next weeks.

Thanks again for your assistance.
