[Distutils] Compiling MySQL extension

Mike Driscoll kyosohma at gmail.com
Tue Dec 11 21:53:55 CET 2007


Hi,

I wanted to give compiling a Windows installer for the Python MySQL
extension that I found here:
http://sourceforge.net/projects/mysql-python

Yes, I know there's already version available for Python 2.4+, but I
need the practice.

Anyway, I have MySQL-5.0.27 installed on my Windows XP SP2 box and I
am using Python 2.4.3. When I go to compile, I get the following:

L:\Temp\MySQL-python-1.2.2>python setup.py bdist_wininst
{'registry_key': 'SOFTWARE\\MySQL AB\\MySQL Server 5.0', 'static': 'False', 'thr
eadsafe': 'True', 'embedded': 'False'}
running bdist_wininst
running build
running build_py
creating build
creating build\lib.win32-2.4
copying _mysql_exceptions.py -> build\lib.win32-2.4
creating build\lib.win32-2.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-2.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-2.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-2.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-2.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-2.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-2.4\MySQLdb
creating build\lib.win32-2.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-2.4\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-2.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.4\MySQLdb\constants

copying MySQLdb\constants\ER.py -> build\lib.win32-2.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.4\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.4\MySQLdb\constants
running build_ext
building '_mysql' extension
Traceback (most recent call last):
  File "setup.py", line 19, in ?
    setup(**metadata)
  File "L:\Python24\lib\distutils\core.py", line 149, in setup
    dist.run_commands()
  File "L:\Python24\lib\distutils\dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "L:\Python24\lib\distutils\dist.py", line 966, in run_command
    cmd_obj.run()
  File "L:\Python24\lib\site-packages\setuptools\command\bdist_wininst.py", line
 37, in run
    _bdist_wininst.run(self)
  File "L:\Python24\lib\distutils\command\bdist_wininst.py", line 107, in run
    self.run_command('build')
  File "L:\Python24\lib\distutils\cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "L:\Python24\lib\distutils\dist.py", line 966, in run_command
    cmd_obj.run()
  File "L:\Python24\lib\distutils\command\build.py", line 112, in run
    self.run_command(cmd_name)
  File "L:\Python24\lib\distutils\cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "L:\Python24\lib\distutils\dist.py", line 966, in run_command
    cmd_obj.run()
  File "L:\Python24\lib\site-packages\setuptools\command\build_ext.py", line 46,
 in run
    _build_ext.run(self)
  File "L:\Python24\lib\distutils\command\build_ext.py", line 279, in run
    self.build_extensions()
  File "L:\Python24\Lib\site-packages\Pyrex\Distutils\build_ext.py", line 82, in
 build_extensions
    self.build_extension(ext)
  File "L:\Python24\lib\site-packages\setuptools\command\build_ext.py", line 175
, in build_extension
    _build_ext.build_extension(self,ext)
  File "L:\Python24\lib\distutils\command\build_ext.py", line 442, in build_exte
nsion
    sources = self.swig_sources(sources, ext)
  File "L:\Python24\lib\site-packages\setuptools\command\build_ext.py", line 77,
 in swig_sources
    sources = _build_ext.swig_sources(self, sources) or sources
TypeError: swig_sources() takes exactly 3 arguments (2 given)


It looks like it wants a third argument, but I don't know what to give
it. Can someone point me in the right direction?

Thanks a lot!

Mike


More information about the Distutils-SIG mailing list