trouble installing MySQLdb (cygwin) + Bonus question
Posted by:
m r
Date: January 24, 2011 04:20PM
Hi,
I'm a python newbie. By newbie I mean two days ago.
It was suggested to me that I work with python.
Unfortunately at work I must run this on a windows machiene.
However, I am having difficultly installing MySQLdb.
First is it even possible under my current environment?
I am using python through cygwin, and have mySQL installed in windows
which mysql returns:
/cygdrive/c/Program Files/MySQL/MySQL Server 5.5/bin/mysql
when I run
python setup.py build it returns:
$ python setup.py build
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/home/Matt/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/home/Matt/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
I've explored various avenues all day to no avail. Can anyone offer a solution or a direction to work towards. One avenue was ignorning the check for posix, and having it run setup_windows, but this just brings in problems with _winreg(?) seeing how I have a posix version of python through cygwin.
Lastly, for the bonus question.
Why MySQLdb why not something like this:
import os
cmd = 'mysql -uroot -pxxx db -e "SELECT * FROM tblxxx;"'
os.system(cmd)
--
why is this a poor idea?
Best,
Matt
Subject
Written By
Posted
trouble installing MySQLdb (cygwin) + Bonus question
January 24, 2011 04:20PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.