Search code examples
pythonpymysql

PyMySql installs in Camel Case, but imports in lower case?


Would one of you Pythonistas please explain why PyMySql installs in Camel Case, but imports in lower case?

>>>pip freeze   
PyMySQL==0.6.2 

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

Solution

  • As you can see here: https://github.com/PyMySQL/PyMySQL/tree/master/pymysql the package is pymysql (Folder with init.py in it) and not PyMySql. So 'import pymysql' is the right way to do it. How you install is part of setup and they are not related.