6

I'm trying to setup python mysql. I'm working through the following tutorial:

http://anthonyscherba.com/site/blog/django-mysql-install-mac

I'm all good until set 5. When I run

$ python setup.py clean

and I get in return

 /Users/msmith/Downloads/MySQL-python-1.2.4b4/distribute-0.6.28-py2.7.egg
 Traceback (most recent call last):
 File "setup.py", line 7, in <module>
    use_setuptools()
  File "/Users/msmith/Downloads/MySQL-python-1.2.4b4/distribute_setup.py", line 145, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "/Users/msmith/Downloads/MySQL-python-1.2.4b4/distribute_setup.py", line 125, in _do_download
    _build_egg(egg, tarball, to_dir)
  File "/Users/msmith/Downloads/MySQL-python-1.2.4b4/distribute_setup.py", line 116, in _build_egg
    raise IOError('Could not build the egg.')
IOError: Could not build the egg.
3
  • You should explicitly state that you're on a Mac, and perhaps indicate which specific point-release. Commented Jul 12, 2013 at 22:56
  • I searched for 'install python-mysql on mac os x' it produced a number of useful resources including: markomedia.com.au/installing-python-mysqldb-on-os-x I've had luck with version 1.2.4 (not b4) Commented Jul 12, 2013 at 22:58
  • No luck, I tried starting over and doing it through his strategy and I arrived at the same error. I am running mac OS X 10.8.4 and MySQL-python-1.2.4b4 Commented Jul 12, 2013 at 23:12

4 Answers 4

6

Nothing helped for me. I had to update MySQL-python to 1.2.5, and that resolved the issue.

MySQL-python==1.2.5
Sign up to request clarification or add additional context in comments.

1 Comment

it's wierd,I have the same issue.
3

I've had success following these tips:

First try installing with pip:

pip install mysql-python

Then: (From here: Django Error: vertualenv EnvironmentError: mysql_config not found)

echo "mysql_config = /usr/local/mysql/bin/mysql_config" >> ~/.virtualenvs/ENV_NAME/build/MySQL-python/site.cfg

Then, (from here: cc1: error: unrecognized command line option "-Wno-null-conversion" within installing python-mysql on mac 10.7.5)

"Try to Remove cflags -Wno-null-conversion -Wno-unused-private-field [from] /usr/local/mysql/bin/mysql_config."

then, simply install again: pip install mysql-python

Then (from here: Python mysqldb: Library not loaded: libmysqlclient.18.dylib)

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

Then it should work!

2 Comments

How can you run pip the second time? When I do, I get the error pip can't proceed with requirement 'mysql-python' due to a pre-existing build directory... I have to delete the directory from the previous run (which of course removes the site.cfg file).
Beats me, never had that issue. Sorry.
1

Please use this version fixes this problem.

https://github.com/qingfeng/MySQLdb1/tree/MySQL-python-1.2.4

Comments

1

I just had this issue...my requirements.txt file looks as bellow:

Django==1.6
MySQL-python==1.2.4
South==0.8.4
...
distribute==0.6.31

What worked for me was:

  1. Comment the line for MySQL-python
  2. Execute the "pip install -r requirements.txt"
  3. Uncomment again MySQL-python
  4. Run again the pip install.

So, I think that the issue is some kind of dependency with the "distribute" version installed (OR to be installed in my case).

1 Comment

Just had this issue and your resolution worked for me aswell. This was for mysql-python 1.2.5 on SLES.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.