trouble installing MySQLdb (cygwin) + Bonus question

Matthew Roth mgroth86 at gmail.com
Tue Jan 25 18:51:06 EST 2011


On Jan 25, 6:20 pm, David Robinow <drobi... at gmail.com> wrote:
> On Tue, Jan 25, 2011 at 5:59 PM, Matthew Roth <mgrot... at gmail.com> wrote:
> > On Jan 25, 9:34 pm, John Nagle <na... at animats.com> wrote:
> ...
> >>     You can install a MySQL server under Windows, and talk to the server
> >> from the Cygwin environment.  That's a useful way to test.
>
> >>                                         John Nagle
>
> > Right, that is precisely what I have. I am able to talk to it from
> > cygwin, however, during the installing of the MySQLdb module it cannot
> > find the mysql_config. This is because It is not installed? The setup
> > sees that I am on a posix system not windows, as python is installed
> > in cygwin, a virtual posix system. I am trying to bulid a mysql client
> > from source for cygwin, however, I am running into an error there.
>
> > Unless, can I talk to the windows mysql_config? if so, what does that
> > look like
>
>  The obvious answer is to use a Windows python. You haven't explained
> why you think you need to run a cygwin python. Can you explain that?


Good question. There isn't a solid explanation. heretofore, I have
been using a lot of bash scripting in combination with awk sed and
some perl. I was directed to look into python. My tasks were becoming
increasingly complex and memory intensive. I started with a desire to
connect to a mysql server. For that I needed to install the MySQLdb
module. I am having difficultly in acomplishment of this task. I
suppose for the time it has taken, using windows python would have
been the simpler route.


Anyway, I have done some tinkering and have moved passed the
mysql_config problem. Thanks to Davids reminder that I have mysql on
windows. Meaning when setup.py called setup_posix.py It was
essentially calling mysql_config. Well mysql_config was in a far off
folder. I setup a symbolic link and that worked. However I was then
presented with a new problem. In direct relation to that far off
folder. Dreaded spaces. (i headed the log)

--
 running build
 running build_py
 copying MySQLdb/release.py -> build/lib.cygwin-1.7.7-i686-2.6/MySQLdb
 running build_ext
 building '_mysql' extension
 creating build/temp.cygwin-1.7.7-i686-2.6
 gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
prototypes -Dversion_info=(1,2,3,'final'
 ,0) -D__version__=1.2.3 -I/usr/include/python2.6 -c _mysql.c -o build/
temp.cygwin-1.7.7-i686-2.6/_mysql.
 o "-I/cygdrive/c/Program Files/MySQL/MySQL Server 5.5/include" "/MT"
"/Zi" "/O2" "/Ob1" "/D" "NDEBUG" "-
 DDBUG_OFF"
 gcc: "-I/cygdrive/c/Program: No such file or directory
--

there is much more, but obviously the problem is " gcc: "-I/cygdrive/c/
Program: No such file or directory"

what I need to do is have it point to /cygdrive/c/Program\ Files/MySQL/
MySQL\ Server\ 5.5/include and not cygdrive/c/Program Files/MySQL/
MySQL Server 5.5/include.

I am currently trying to track that down. I think I am going to leave
work and go grab some dinner. perhaps I will solve this later tonight.

Best,
Matt




More information about the Python-list mailing list