MySQLdb don’t yet have support for python 3, it supports only python 2.4 – 2.7. As a result you need to use python 2 for this tutorial. We will be using python 2.7.9, which you can download from here. MySQLdb, Python, MySQL and OS X: A match made in Satan’s bum. 21 Sunday Feb 2010. You if you’re having trouble getting MySQL-python installed or don’t know what to do when you get the message “No module named MySQLdb”. There seems to be a million and one articles out there about setting this combo up most of them seem.
I am current using Mac OS X 10.12.I am trying to install MySQLdb but kept getting these error.
When I running sudo pip install MySQLdb,the error message is:
and then I try to download MySQL-python-1.2.4b4, and use that to directly running setup.py.Then I got this error:
Download Mysqldb For Python
Tried lots of solutions out there.Still got lots of errors.Plz help here.
1 Answer
The problem is the MySQL-python package does not currently support Python 3.
You could use another mysql package like mysqlclient which is a fork of MySQL-python, supports Python 3 and has worked well for me:
Or if you still need to use MySQL-python you could try installing it in Python 2.7 and use that for development:
Hope this helps.
damoresdamoresNot the answer you're looking for? Browse other questions tagged mysqldjangomacospython-2.7 or ask your own question.
I have trouble installing bitarray
(vers 0.8.0) on my Mac OSX 10.7.4. Thanks!
gcc
does not seem to be the problem:
1 Answer
The setup is trying to run the command gcc-4.2
, which doesn't seem to exist on your system. Verify by running which gcc-4.2
or locate gcc-4.2
(you may need to run /usr/libexec/locate.updatedb
before you can use the latter command). In case it doesn't exist, simply create a symlink in the same directory in which the gcc
binary resides: