farcepest / MySQLdb1

MySQL database connector for Python (legacy version)
https://sourceforge.net/projects/mysql-python/
666 stars 318 forks source link

Issues with installation using pip and with building source #119

Open nikhileshva opened 8 years ago

nikhileshva commented 8 years ago

I get this error when I install it through pip

building '_mysql' extension
creating build/temp.macosx-10.12-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/Applications/XAMPP/xamppfiles/include/mysql -I/Applications/XAMPP/xamppfiles/include/mysql/.. -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.12-intel-2.7/_mysql.o
_mysql.c:44:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
         ^
1 error generated.
error: command 'cc' failed with exit status 1
lixuemuyangfeng commented 6 years ago

have you figured it out?

nikhileshva commented 6 years ago

Umm, I don't remember how I solved it. It's almost two years now.

pchhetri commented 6 years ago

Looks like this only supports up to the current legacy version of mysql - version 5.7. Best to probably switch to other connectors: https://stackoverflow.com/a/51351548

Anyways on a Mac the fix was:

brew remove mysql
brew install mysql@5.7
brew link --force mysql@5.7
pip install msyql-python

@lixuemuyangfeng

aperezalbela commented 4 years ago

Looks like this only supports up to the current legacy version of mysql - version 5.7. Best to probably switch to other connectors: https://stackoverflow.com/a/51351548

Anyways on a Mac the fix was:

brew remove mysql
brew install mysql@5.7
brew link --force mysql@5.7
pip install msyql-python

@lixuemuyangfeng

Please edit typo from:

pip install msyql-python

To:

pip install mysql-python

methane commented 4 years ago

This project is not maintained for a long time. Use pip install mysqlclient instead.