I installed MySQL connector Python 8.0.11 using pip3
and it was installed successfully. I am running this on my macOS. And whenever I try import mysql.connector
there is a trace back error "ModuleNotFoundError: No module named 'mysql'
". How can I solve this?
Asked
Active
Viewed 406 times
0

David Buck
- 3,752
- 35
- 31
- 35
-
what python you are using anaconda or python3.x? just check where the packages stored after the installation. – Subbu VidyaSekar Apr 27 '20 at 03:57
-
1Does this answer your question? [ImportError: No module named 'MySQL'](https://stackoverflow.com/questions/32877671/importerror-no-module-named-mysql) – Apr 27 '20 at 07:01
-
@kkheelan now the trace back error says that no module named dns.resolver. I searched the directory and i have download mysql-connector-python-rf too. what could i do? – Nikesh shah Apr 28 '20 at 02:42
-
@Nikesh shah you can try to install dnspython using pip. But if it doesn't work, sometimes pip doesn't work for some modules then you have to follow the answer of this link to install dns. https://stackoverflow.com/questions/21641696/python-dns-module-import-error – Apr 28 '20 at 02:52