Can't compile mysqldb-python module in Slackware 12.2
Trying to get Mytharchive working in Mythtv. A normal Slack 12.2 installation with mysql, Python, and Python-PIL (from linuxpackages.net) installed. The mythburn.py script complains that it can't find the mysqldb module.
All attempts to compile this module according to the instructions for MYSQL-python-1.2.2 using the command "python setup.py build" fail, with a screen output as follows running build running build_py creating build creating build/lib.linux-i686-2.5 copying _mysql_exceptions.py -> build/lib.linux-i686-2.5 creating build/lib.linux-i686-2.5/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-i686-2.5/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-i686-2.5/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-i686-2.5/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-i686-2.5/MySQLdb copying MySQLdb/release.py -> build/lib.linux-i686-2.5/MySQLdb copying MySQLdb/times.py -> build/lib.linux-i686-2.5/MySQLdb creating build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.5/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.5/MySQLdb/constants running build_ext building '_mysql' extension Traceback (most recent call last): File "setup.py", line 19, in <module> setup(**metadata) File "/usr/lib/python2.5/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.5/distutils/dist.py", line 974, in run_commands self.run_command(cmd) File "/usr/lib/python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "/usr/lib/python2.5/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/lib/python2.5/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 46, in run File "/usr/lib/python2.5/distutils/command/build_ext.py", line 290, in run self.build_extensions() File "/usr/lib/python2.5/site-packages/Pyrex/Distutils/build_ext.py", line 82, in build_extensions self.build_extension(ext) File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 175, in build_extension File "/usr/lib/python2.5/distutils/command/build_ext.py", line 453, in build_extension sources = self.swig_sources(sources, ext) File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 77, in swig_sources TypeError: swig_sources() takes exactly 3 arguments (2 given) Since I know absolutely zero about python in general, any idea what I'm doing wrong in the compiling of mysqldb-python? Or does anybody know where a precompiled binary of this python module may be had? Thx in advance. |
There is a build script on SlackBuilds which I have used (in Slackware 12.0) that works.
|
Quote:
I wonder whether the current 2.5.2 version of python in Slack 12.2 just happens to break the setup.py script in the mysqldb-python module source. |
Well I just tried the Slackbuild on a clean Slackware 12.2 install (after installing pysetuptools). It worked fine so I suspect something else is wrong on your system. Sorry I can't be more helpful but look at what else you have installed.
|
Quote:
But at least now I know the python module ought to compile on Slack 12.2. I guess I'll have to dig into the python script and try to figure out why the line is coming up one argument short. All the best. |
Remove PIL and install it again with this SlackBuild script.
With a bit of luck MYSQL-python will compile then. |
Quote:
File "build/bdist.linux-i686/egg/setuptools/command/build_ext.py", line 77, in swig_sources TypeError: swig_sources() takes exactly 3 arguments (2 given) So I guess I'll be needing to poke around in the inner workings of python scripts than I initially planned. Oh well... |
I found a probable solution here.
I don't know anything about python, so I wouldn't even know how to implement it however... But maybe you do (or someone else) and it leads to a compilation. Good luck! |
I've just uploaded my built package to a filesharing site if you want to download it i'ts here - it may be quicker to download and install this rather than mess around with your installed packages.
Sorry I didn't think of this earlier - better late than never ! |
Quote:
It does look as though adriv has found the trail to the complete solution, with mismatched "def swig_sources" lines in the setup.py and in the version of Python installed. I'll need to explore further as time permits how this is reflected in my own Python installation in 12.2. I wonder if your compiled MySQL-python 1.2.2 package should perhaps be submitted to an archive like linuxpackages.net? It certainly falls within the scope of needs they traditionally address. Thanks again! All the best. |
Quote:
Quote:
Glad it worked for you. |
Quote:
bgeddy kindly passed a precompiled binary to me which works fine. But when I read (and reread) the thread you found on mismatched required arguments in the "def swig_sources" line, I began to wonder if, like in the Pyrex compile you found the thread on, the current 2.5.2 version of Python breaks the MySQL-python setup routine (which the README says is supported Python 2.3-2.5). Sure enough, after a downgrade to Python 2.4.3 (Slack 11.0), the MySQL-python interface compiles perfectly. I guess "2.3-2.5" doesn't necessarily mean 2.5.2 ! Thanks again! |
@croxen - as an experiment I uninstalled the pysetuptools I had built from SlackBuilds available here and uninstalled the MySQL-python-1.2.2 I had succesfully built. I then tried to run the SlackBuild for MySQL-python again and got exactly the same errors you originally reported.
So - in a nutshell - are you sure you built and installed pysetuptools from SlackBuilds as is recomended to build MySQL-python ? |
Quote:
You're right, I didn't specifically install pysetuptools. My initial attempt with the mysqldb module was to compile from source, in which process the setup.py in the MySQL-python-1.2.2 tarball went out and downloaded the pysetuptools it claimed it needed on its own. I went out to try the SlackBuilds script only after compiling from the tarball kept failing because of the swig_sources error. Your experiment shows that setup.py must be downloading a version of pysetuptools not-quite-compatible with Python 2.5.2. In my own experiment, after I backleveled Python to 2.4.3 (from Slack 11), I had no further trouble from the SlackBuild script, and just compiling from source also works now. |
All times are GMT -5. The time now is 09:42 PM. |