1

I want to install mysqlclient and using it with python3 so just type in command line:

$ sudo -H pip3 install mysqlclient
Requirement already satisfied: mysqlclient in /usr/local/lib/python3.5/dist-packages

and then

$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysqlclient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'mysqlclient'

What is wrong here?

Note: libmysqlclient-dev it's already installed with most recent version (5.7.17-0ubuntu0.16.04.2)

1 Answer 1

2

Try: import MySQLdb

mysqlclient is actually a port for mysqldb to Python 3.x. They changed the name of the lib so it won't conflict with the original one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.