MySQL Forums
Forum List  »  Connector/Python

mysql-connector-python for python3 installed - where?
Posted by: Per Anton Ronning
Date: January 29, 2018 05:11AM

I run Linux Mint 18.3 based on Ubuntu16.04.1. I have started to use python3.6 which I installed (python 2.7 & 3.5 obviousli came with the distro Mint 18.3)
I have (via the community page) tried to install mysql-connector-python-cext-py3
The installer displays some directories which I guess are relevant directories from where to import mysql connector.
But none of these directories seem to contain the names that I suppose must be imported into the python script to connect to the database.
I have from the installer:
1)usr/lib/python3/dist-packages/_mysql_connector.cpython-35m-i386-linux-gnu-so.
2)usr/share/dic/mysql-connector-python-cext-py3/
I also have in my file system
3)usr/lib/python3/dist packages/mysql/connector
in 3) there is no .py module called connector, only one called connection.py.

Trying this:
#!/usr/lib/python3/disp-packages/mysql/connection
from __future__ import print_function

import mysql.connection
from mysql.connection import errorcode

Results in failure.
Traceback (most recent call last):
File "testsql.py", line 4, in <module>
import mysql.connection
ModuleNotFoundError: No module named 'mysql'

So, this construct requires a mysql mdule , byt I do not know where it can be found. Something may have gone wrong during installation.
Can you give me the necessary hints?

Options: ReplyQuote


Subject
Written By
Posted
mysql-connector-python for python3 installed - where?
January 29, 2018 05:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.