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??

NightOwl19
  • 419
  • 5
  • 24
  • duplicate of http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found – Raja Simon Jun 20 '15 at 14:18

1 Answers1

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
doniyor
  • 36,596
  • 57
  • 175
  • 260
  • 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. – NightOwl19 Jun 20 '15 at 14:59
  • 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? – FlipperPA Jun 20 '15 at 20:39
  • 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? – NightOwl19 Jun 21 '15 at 03:23