This is the error I get
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Do
sometimes the error depends on the actual cause. we had a case where mysql-python was installed through the python-mysqldb debian package.
a developer who didn't know this, accidentally ran pip uninstall mysql-python
and then failed to recover with pip install mysql-python
giving the above error.
pip uninstall mysql-python
had destroyed the debian package contents, and of course pip install mysql-python
failed because the debian package didn't need any dev files.
the correct solution in that case was apt-get install --reinstall python-mysqldb
which restored mysql-python to its original state.
on MacOS Mojave, mysql_config is found at /usr/local/bin/ rather than /usr/local/mysql/bin as pointed above, so no need to add anything to path.
apt-get install libmysqlclient-dev python-dev
Seemed to do the trick.
You should install the mysql
first:
yum install python-devel mysql-community-devel -y
Then you can install mysqlclient
:
pip install mysqlclient
You can use the MySQL Connector/Python
Installation via PyPip
pip install mysql-connector-python
Further information can be found on the MySQL Connector/Python 1.0.5 beta announcement blog.
On Launchpad there's a good example of how to add-, edit- or remove data with the library.
Due to changes within osx mavericks & xcode development tools you may get the error on installation
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
therefore use :
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mysql-python