Python3 mysqlclient-1.3.6 (aka PyMySQL) usage?

Im still very much learning python and all the different ways to use 3rd party modules. I have installed which was recommended here Python 3 and MySQL

I believe i installed the package correctly

D:installpython modules>python -m pip install mysqlclient-1.3.6-cp34-none-win_amd64.whl
Unpacking d:installpython modulesmysqlclient-1.3.6-cp34-none-win_amd64.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient
Cleaning up...

weird thing is when i try and import the module mysqlclient I get the below

D:installpython modules>python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
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'

I checked the homepage and I couldnt find any examples on how to use this module. I am quite confused, have I just majorly missed the boat here?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The PyMySQL project includes a user guide. It’s not so easy to find this guide (there are no obvious links) and to add to the confusion, the module name does not correspond with the package name. To use it, you need:

import MySQLdb

The MySQLdb module implements PEP 249 – the Python Database API Specification for accessing databases. When using this API, Python code should be more portable across different relational database management systems.

It’s not recommended to use the _mysql module (which is also included in this package). It’s not portable and it works at a lower level of abstraction (implementing the MySQL C API).

Here are two tutorials that you might find useful. I’ve used them with
the original MySQLdb package in Python 2 but the API is the same (as defined by PEP-249). They both contain practical examples of database access (reading and writing data) and I found them to be better for getting started with the API than the official documentation.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x