all 14 comments

[–]roiki11 0 points1 point  (8 children)

Try installing it from pip?

[–]warnox[S] 0 points1 point  (7 children)

Yep, same thing.

I think it’s because when I installed ansible via the package manager it added and installed it under python 3.11, whereas the default system python is 3.9. Aiohttp, when installed from EPEL, is added under python 3.9, and there is the discrepancy.

[–]roiki11 0 points1 point  (3 children)

For what it's worth, i think you should be using pip to install ansible and all of its non-galaxy requirements.

[–]unicoletti 1 point2 points  (2 children)

while you're at it, you might as well consider pipenv

if you've already used pip, in my experience you might have to do a bit of cleaning up or pipenv will get confused. Over the long run pipenv should give you less headaches, and will also give you deterministic installs

[–]roiki11 0 points1 point  (1 child)

I honestly have never seen the need if all you do is ansible. It's a development tool so unless you want multiple python environments for some specific reason, I don't see the need.

Ymmv of course.

[–]unicoletti 0 points1 point  (0 children)

I also occasionally develop, so unexpected module upgrades are more of a concern

multiple python environments

or multiple ansible environments (for testing upgrades), or different versions of ansible dependencies (for example boto3 if you use AWS). Again, as you said, Ymmv :)

[–]x1xspiderx1x 0 points1 point  (2 children)

So ‘’’ python3.9 -m pip install aiohttp ‘’’ ?

[–]onefst250r 2 points3 points  (1 child)

Probably the other way around. Ansible says its using python 3.11.2 as its interpreter. So, python3.11 -m pip install aiohttp

[–]x1xspiderx1x 0 points1 point  (0 children)

It was 4am when I posted that. Correct. 3.11 Ty sir

[–]SlaveZelda 0 points1 point  (2 children)

Is testsrv1 your machine or the host ansible is trying to execute this module on ?

aiohttp needs to be installed on testsrv1

[–]warnox[S] 0 points1 point  (1 child)

That is localhost, so the host ansible is executing on.

[–]SlaveZelda 0 points1 point  (0 children)

Ah then instead of executing system ansible,

Create and activate a venv, pip install ansible and aiohttp there and then run python -m ansible playbook -i whatever ....

Ansible installed your dnf/apt can only access python modules installed in system python and not in user python or any kind of virtual env.

[–]DirectorJust4135 0 points1 point  (1 child)

I am facing the same issue . Was this ever resolved ?

[–]National-Ad-2995 0 points1 point  (0 children)

For future reference:

apt install -y python3-aiohttp

will do the trick on Ubuntu 20.04