3

i've been trying to install mysql for my django project.I am running osx yosemite 10.10 and django=1.7, python 2.7, and also virtual env. when i tried to run pip install MySQL-python then the following error appears:

You are using pip version 6.0.8, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
DEPRECATION: --no-install and --no-download are deprecated. See  https://github.com/pypa/pip/issues/906.
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
sh: mysql_config: command not found
 Traceback (most recent call last):
  File "<string>", line 20, in <module>
  File "/Volumes/DiskSecond/pythonsNest/env2/build/MySQL-python/setup.py", line 17, in <module>
    metadata, options = get_config()
  File "setup_posix.py", line 43, in get_config
    libs = mysql_config("libs_r")
  File "setup_posix.py", line 25, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found

Traceback (most recent call last):

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

  File "/Volumes/DiskSecond/pythonsNest/env2/build/MySQL-python/setup.py", line 17, in <module>

    metadata, options = get_config()

  File "setup_posix.py", line 43, in get_config

    libs = mysql_config("libs_r")

  File "setup_posix.py", line 25, in mysql_config

    raise EnvironmentError("%s not found" % (mysql_config.path,))

  EnvironmentError: mysql_config not found

  ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in /Volumes/DiskSecond/pythonsNest/env2/build/MySQL-python

i've globally installed python on my system but django is installed in virtualenv named==env2. when i check my env2's build folder then there is already a folder named s present with all the mysql files.but still the error appears while installing it using pip.where is the problem??

1

1 Answer 1

2

you need to do this in your console:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

then

brew install mysql
pip install mysql-python
Sign up to request clarification or add additional context in comments.

3 Comments

well i'm running it for django, so how does the ruby command work? also when i tried to run brew install mysql, it showed me an error.
He needs to get the equivalent of the mysql-devel package for CentOS / RHEL or libmysqlclient-dev for Ubuntu/Debian, unless brew handles it all?
also, i have already installed xampp for mysql and phpmyadmin..so is it possible that because of that, the mentioned error is appearing. also i tried to locate my mysqld file, and it's showing when i try to list it recursively from xampp applications directly but when i tried to run it, it didn't appear at all?

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.