B
B
big_hasan2015-11-25 08:14:45
MySQL
big_hasan, 2015-11-25 08:14:45

I can't install Mysql Connector, it gives an error "ImportError: No module named 'mysql'", how to fix it?

I downloaded the MySQL Connector msi file from the off site and ran it - everything seemed to be fine. After I tried to execute the following command in python: it
import mysql.connector
gives an error I can’t understand what’s wrong, I’m just starting to code. PS: MySQL 5.7.9, installed as Chukchi through unpacking the archive, everything seems to be working fine.
ImportError: No module named 'mysql'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nirvimel, 2015-11-25
@big_hasan

For MySQL on Windows, use PyMySQL . It is easily installed via pip:
pip install mysqlclient

M
masterziv, 2015-12-06
@masterziv

For MySqlDb to work, a MySQL client must be installed on the machine, because in the end the work goes through it. You don't have it, that's why you're in trouble. The MySQL client can be found on the MySQL website.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question