0

I'm trying to install python-myconnector using the instructions provided here.

The installation succeeds:

(my_virtual_env)[my.username@my-machine ~]$ pip install mysql-connector
...
Successfully installed mysql-connector

However, then when I try to use it, importing the mysql.connector module fails. What?? Why???

(my_virtual_env)[my.username@my-machine ~]$ python
Python 2.7.12 (default, Sep  1 2016, 22:14:00)


>>> import mysql.connector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mysql.connector

Here is the full log of the installation and usage.

Saqib Ali
  • 11,931
  • 41
  • 133
  • 272

1 Answers1

1
pip install mysql-connector-python

This worked for me in python 2.7.12 venv.

Also you can see a discussion on this here.

aprasanth
  • 1,079
  • 7
  • 20