5

When trying to install requirements.txt for Django I get the following error when trying to install Mysql-python

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/abercrrl/.virtualenvs/django_at/build/MySQL-python/setup.py", line 7, in <module>

    use_setuptools()

  File "distribute_setup.py", line 145, in use_setuptools

    return _do_download(version, download_base, to_dir, download_delay)

  File "distribute_setup.py", line 125, in _do_download

    _build_egg(egg, tarball, to_dir)

  File "distribute_setup.py", line 116, in _build_egg

    raise IOError('Could not build the egg.')

IOError: Could not build the egg.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/abercrrl/.virtualenvs/django_at/build/MySQL-python
Storing debug log for failure in /home/abercrrl/.pip/pip.log

Note that I have tried:

pip install --upgrade setuptools 

Setuptools is already up-to-date


Edit:

I modified the following command to match my locations:

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

I did have to create the build and MySQL-python directories for this to work. The command ran fine, however now I am getting this now: https://gist.github.com/rlabercrombie/8725074

richard008
  • 403
  • 7
  • 15
  • you should provide more information, and paste the file /home/abercrrl/.pip/pip.log. have you tried to manually do `pip install MySQL-python`? – caesarsol Jan 30 '14 at 23:58
  • 1
    [This answer](http://stackoverflow.com/a/17756333/3219121) has the fix for that issue. – matagus Jan 31 '14 at 00:09
  • @caesarsol the entire file is way too large to post here. Is there a good way to post large amounts of code? Manual pip install MySQL-python produces the same error – richard008 Jan 31 '14 at 00:54
  • 1
    @richard008: the user matagus gave you what i think is the right answer. the next time paste the last lines of the log file, or paste it in https://gist.github.com/ or http://pastebin.com/ – caesarsol Jan 31 '14 at 01:02
  • @caesarsol I have updated my post with another error. – richard008 Jan 31 '14 at 01:39
  • @matagus I have updated my post with another error. – richard008 Jan 31 '14 at 01:39

1 Answers1

5

you must install mysql dev and all required libraries in order to mysql-python to be build: sudo apt-get install build-essential python-dev libmysqlclient-dev python-mysqldb. See for details http://mysql-python.blogspot.no/2012/11/is-mysqldb-hard-to-install.html or https://stackoverflow.com/a/7461662/3219121

Community
  • 1
  • 1
matagus
  • 6,136
  • 2
  • 26
  • 39