I have downloaded the PyMySql using sudo pip3 install pymysql and it showed that python module was installed successfully.
But when I try to import it, it is showing that no module is available with this name.
Actually I was writing a playbook for mysql root user password updation in Ansible where Ansible needs this pymysql module.
The ansible script is not getting PyMySql
or MySql-python
as it is shown in the second image. You have to check which python version you are using for ansible and fix the python path in ansible script to show where your PyMySql
module is.
As this is a problem related to ansible, you can add the tag ansible
for this question.
Can you try the below command ?
python3 -m pip3 install pymysql
and then use
import pymysql
in your command?
To work mysql, we need mysql driver and programming language specific client library. Looks you have installed client libraries.
Check on how to install driver as per your operating system.
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.