1.1.9 setup.py broken for Windows
MySQL database connector for Python programming
Brought to you by:
adustman
The new setup.py uses the mysql_config external program
for determining libraries and other items needed for
compiling client programs. Sadly (for Windows users),
this is a shell script and seems to not be included
with the Windows installation of MySQL-4.1. I will
probably have to add a separate configuration section
for Windows similar to that in 1.1.8 and earlier, but I
am open to suggestions. I have been told by people who
have made Windows packaging that setup.py needed to be
patched anyway, but I have never had specifics on what
the problem might be.
Logged In: YES
user_id=71372
The current CVS version should be usable for Windows. Note
that you must set an environment variable (mysqlroot) that
is the path to your MySQL installation.
Logged In: YES
user_id=274034
There are some issues with un-initialized variables on
Windows. Here's one traceback:
C:\temp\MySQLdb>python setup.py biuld
Traceback (most recent call last):
File "setup.py", line 52, in ?
libraries.extend(['zlib', 'msvcrt', 'libcmt', 'wsock32',
'advapi32'])
NameError: name 'libraries' is not defined
I went in to the setup.py and added the following at line 41:
libraries = []
My new traceback error is:
C:\temp\MySQLdb>python setup.py build
Traceback (most recent call last):
File "setup.py", line 136, in ?
extra_compile_args=extra_compile_args,
NameError: name 'extra_compile_args' is not defined
For which I added the following at line 42:
extra_compile_args = []
Now it runs fine. I get a lot of "unresolved external
symbol" errors from Visual Studio compiler, but that's
probably my fault :(
Note: I would generate a patch for this from diff if I knew
how to do it and how to submit it. Would that be useful?
Are you accepting patches from outside?
Logged In: YES
user_id=71372
I think I need to add this:
'mysqlclient.lib') ]
and add the extra_objects back into the compile options for
Extension; I think this will fix your symbol problems. I'll
work on this later tonight.
You can probably just change libraries.extend() to libraries
= and make that work.
Patches are welcome, if you can generate them. diff is the
usual tool for this, but I'm not optimistic about you having it.
Looking at the 1.1.8 version may be instructive:
http://cvs.sourceforge.net/viewcvs.py/mysql-python/MySQLdb/setup.py?rev=1.47&view=markup
Logged In: YES
user_id=274034
I followed your advice on extra_objects and it seems to have
worked.
I have generated a patch file for setup.py using diff -c (I
have cygwin installed). How can I check it in? I assume it
goes into some testing branch or something.
Logged In: YES
user_id=71372
Submit it as an attachment/upload to this bug.
Logged In: YES
user_id=274034
How do I submit an attachment to this bug?
Logged In: YES
user_id=71372
Scroll to the bottom.
Logged In: YES
user_id=274034
I see the (empty) list of attachments, but I don't see any
links there allowing new attachments.
Logged In: YES
user_id=71372
So you can't see the bit just above it where it says "Check
to Upload and Attach a File:"?
Logged In: YES
user_id=274034
Nope. I looked with both Firefox and IE and neither has the
option to Attach a file. Perhaps one needs developer
access? Not that I'm asking for it, just a thought as to
why I can't upload.
Logged In: YES
user_id=71372
The only thing I can think of is that you didn't submit the
bug, so you can't attach things, which is kinda dumb. Just
paste it in as a comment and I'll deal with it. That or
submit it as a patch in the Patch Tracker; your choice.
Logged In: YES
user_id=71372
Try the latest CVS revision (1.52) and see if it works for
Windows.