Unable to find any of pip3 to use. pip needs to be installed

I am trying to use my community.mysql.mysql_user and other mysql module am getting this error, Please help to fix this issue

What Linux disto(s) are you targetting? I expect most package PyMySQL, so best use the distro package, eg:

If your distro doesn’t ship pymysql then you would need to install the pip3 package prior to using ansible.builtin.pip, however I’d suggest that you might be better off using community.general.pipx as it won’t conflict with the system Python packages as it uses virtual environments.

using almalinux9 as manage node
Now am getting this error after using community pip module

fatal: : FAILED! => {“changed”: false, “cmd”: “/bin/pip3 list --include-injected --json”, “msg”: “\nUsage: \n pip3 list [options]\n\nno such option: --include-injected”, “rc”: 2, “stderr”: “\nUsage: \n pip3 list [options]\n\nno such option: --include-injected\n”, “stderr_lines”: [“”, "Usage: “, " pip3 list [options]”, “”, “no such option: --include-injected”], “stdout”: “”, “stdout_lines”: }

PLAY RECAP **********************************************************************************

The --include-injected option is a pipx flag not a pip3 one, that is why you task failed, however:

I’ve not used RedHat based distros for a long time, someone else here will hopefully be able to help you — I would expect Redhat based distros would provide a packaged version of the Python PyMySQL library and I’d suggest you would be best off using that rather than installing your own version :person_shrugging: .

Thanks for the response, @chris, am expecting somebody will help me to resolve this issue.

Based on the title of this article the RPM you need to install is called python3-PyMySQL, so why don’t you try using the ansible.builtin.dnf module to install this package?

Thanks @chris it working after installing python3-PyMySQL

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.