Fix Python – What’s the difference between MySQLdb, mysqlclient and MySQL connector/Python?

So I’ve been trying to do some database update with python and while setting up the whole dev environment, I came across these three things which made me dizzy.

There’s MySQLdb
There’s mysqlclient
And then there’s a mysql connector python

What’s each of them, the difference and where to use them? Thanks
….

Fix Python – ImportError: No module named MySQLdb

I am referring the following tutorial to make a login page for my web application.
http://code.tutsplus.com/tutorials/intro-to-flask-signing-in-and-out–net-29982
I am having issue with the database.
I am getting an
ImportError: No module named MySQLdb

when I execute
http://127.0.0.1:5000/testdb

I have tried all possible ways to install pytho….

Fix Python – Visibility of global variables in imported modules

I’ve run into a bit of a wall importing modules in a Python script. I’ll do my best to describe the error, why I run into it, and why I’m tying this particular approach to solve my problem (which I will describe in a second):
Let’s suppose I have a module in which I’ve defined some utility functions/classes, which refer to entities defined in the ….

Fix Python – Python mysqldb: Library not loaded: libmysqlclient.18.dylib

I just compiled and installed mysqldb for python 2.7 on my mac os 10.6. I created a simple test file that imports
import MySQLdb as mysql

Firstly, this command is red underlined and the info tells me “Unresolved import”. Then I tried to run the following simple python code
import MySQLdb as mysql

def main():
conn = mysql.connect( charset=”u….

Fix Python – pip install mysql-python fails with EnvironmentError: mysql_config not found

This is the error I get
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File ““, li….

Fix Python – Installing specific package version with pip

I am trying to install version 1.2.2 of MySQL_python, using a fresh virtualenv created with the –no-site-packages option. The current version shown in PyPi is 1.2.3. Is there a way to install the older version? I have tried:
pip install MySQL_python==1.2.2

However, when installed, it still shows MySQL_python-1.2.3-py2.6.egg-info in the site pack….