Using pip I installed mysql-python, got:
Successfully installed MySQL-python-1.2.5
However when I try to import MySQLdb I get:
ImportError: No module named MySQLdb
locate MySQLdb gives me:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQLdb
Why is Python not finding the module?
Thanks!
Gil.
Related
i have this error:
import mysql.connector
ModuleNotFoundError: No module named 'mysql'
I already install via pip3 mysql and mysql-connector
and of course also call import mysql.connector
im using xampp version 8.0.0 in my m1 I don't know if that will be the problem
pip3 list
error
I want to check MX-Record from Python. So I installed the dnspython package, but when I try to import following library:
import dns.resolver
It shows the following error:
ModuleNotFoundError: No module named 'dns'.
I use PyCharm and Python 3.
You should install https://github.com/rthalley/dnspython first
pip install dnspython
I am trying to use MySQL in Apache Airflow. I already use PymySQL to query MySQL databases and did not have MySQLDb installed. Thus I got the error:
from airflow.hooks.mysql_hook import MySqlHook
File "/anaconda3/anaconda/lib/python3.6/site-packages/airflow/hooks/mysql_hook.py", line 15, in <module>
import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'
If I go into mysql_hook.py class I already see they are using MySQLDB
import MySQLdb
import MySQLdb.cursors
What alternative I have other than importing pymysql manually instead of in a hook?
I am using Python 3.6
Thanks
In order for the MySQL hook to work in Airflow, you need to install the MySQL extra package. If you have installed Airflow with pip, then the following command will do:
pip install apache-airflow[mysql]
This will install the mysqlclient package, which is the one required here.
I use computer that is Window 10 and my Python version is 3.6.
I installed pymysql and MySQLdb as in the picture below.
But When I tried to run python, I got this error : No module named 'pymysql'
also, MySQLdb...
How can I solved it?
Try to use pip3 install PyMySQL and import pymysql
I want to check MX-Record from Python. So I installed the dnspython package, but when I try to import following library:
import dns.resolver
It shows the following error:
ModuleNotFoundError: No module named 'dns'.
I use PyCharm and Python 3.
You should install https://github.com/rthalley/dnspython first
pip install dnspython