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

6
  • you should provide more information, and paste the file /home/abercrrl/.pip/pip.log. have you tried to manually do pip install MySQL-python? Commented Jan 30, 2014 at 23:58
  • 1
    This answer has the fix for that issue. Commented Jan 31, 2014 at 0: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 Commented Jan 31, 2014 at 0: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 gist.github.com or pastebin.com Commented Jan 31, 2014 at 1:02
  • @caesarsol I have updated my post with another error. Commented Jan 31, 2014 at 1:39

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

3 Comments

Quick question. mysql is currently installed on the server, will this overwrite any existing files?
no. it only installs python and compiler-related libs
Thanks for the first link, helped a lot, I was missing the mysql dev libraries. Also, in case any fedora users come around, it was yum install mysql-devel

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.