LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-06-2009, 09:02 PM   #1
croxen
Member
 
Registered: May 2002
Posts: 100

Rep: Reputation: 42
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.
 
Old 03-06-2009, 09:31 PM   #2
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
There is a build script on SlackBuilds which I have used (in Slackware 12.0) that works.
 
Old 03-07-2009, 12:11 PM   #3
croxen
Member
 
Registered: May 2002
Posts: 100

Original Poster
Rep: Reputation: 42
Quote:
Originally Posted by bgeddy View Post
There is a build script on SlackBuilds which I have used (in Slackware 12.0) that works.
Thanks, but the slackbuilds.org script breaks down at exactly the same point with the same swig_sources error message as just running the setup.py script does.

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.
 
Old 03-07-2009, 12:48 PM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
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.

Last edited by bgeddy; 03-07-2009 at 12:54 PM.
 
Old 03-07-2009, 04:13 PM   #5
croxen
Member
 
Registered: May 2002
Posts: 100

Original Poster
Rep: Reputation: 42
Quote:
Originally Posted by bgeddy View Post
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.
Thanks, will do. There's a fair amount of additional stuff on the box pursuant to dependencies necessary for compiling and running Mythtv. Mytharchive, nuvexport, and some of the maintenance perl scripts are pretty much the only bits I haven't got going yet.

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.
 
Old 03-07-2009, 04:36 PM   #6
adriv
Member
 
Registered: Nov 2005
Location: Diessen, The Netherlands
Distribution: Slackware 15
Posts: 700

Rep: Reputation: 43
Remove PIL and install it again with this SlackBuild script.

With a bit of luck MYSQL-python will compile then.
 
Old 03-08-2009, 11:26 AM   #7
croxen
Member
 
Registered: May 2002
Posts: 100

Original Poster
Rep: Reputation: 42
Quote:
Originally Posted by adriv View Post
Remove PIL and install it again with this SlackBuild script.

With a bit of luck MYSQL-python will compile then.
Thanks! But while the slackbuild you showed me for PIL works like a champ, and the reulting package installs fine, it doesn't seem to affect the compile for mysqldb-python for me, which still breaks down at the same point with:

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...
 
Old 03-08-2009, 03:31 PM   #8
adriv
Member
 
Registered: Nov 2005
Location: Diessen, The Netherlands
Distribution: Slackware 15
Posts: 700

Rep: Reputation: 43
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!
 
Old 03-08-2009, 03:58 PM   #9
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
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 !
 
Old 03-09-2009, 05:46 AM   #10
croxen
Member
 
Registered: May 2002
Posts: 100

Original Poster
Rep: Reputation: 42
Smile

Quote:
Originally Posted by bgeddy View Post
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 !
Thanks a million! The binary packege installed and functions flawlessly. Mythburn.py now initializes, and I can settle back down down to the more usual intractable problems with the always awful ffmpeg ... but that's another thread.

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.
 
Old 03-09-2009, 08:41 AM   #11
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
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.
Yes it looks like adriv is on the right track with his information. I've had a quick look at the supplied link and it looks relevant - I'll be looking deeper when I get chance with a view to providing a patch possibly.
Quote:
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.
I'll have to have a think about this as LP doesn't have a good reputation and SlackBuilds provide a build for this (although it wouldn't work in your case !)

Glad it worked for you.
 
Old 03-09-2009, 04:14 PM   #12
croxen
Member
 
Registered: May 2002
Posts: 100

Original Poster
Rep: Reputation: 42
Talking

Quote:
Originally Posted by adriv View Post
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!
Looks like you found it. Thanks!

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!
 
Old 03-09-2009, 07:57 PM   #13
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
@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 ?
 
Old 03-10-2009, 08:58 AM   #14
croxen
Member
 
Registered: May 2002
Posts: 100

Original Poster
Rep: Reputation: 42
Quote:
Originally Posted by bgeddy View Post
@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 ?
Ah ha!

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python MySQLdb create simple menu comprookie2000 Programming 0 08-16-2008 07:58 PM
Etch 4.0 stable - python 2.5 and python-mysqldb? jantman Debian 1 06-06-2008 02:34 PM
Python MySQLdb syntax issues... elvenson Programming 4 12-18-2007 12:36 PM
problem installing mysqldb for python ssaigol Slackware 1 06-15-2005 02:45 PM
Help me (python and MySQLdb module) Dark Carnival Programming 2 04-22-2004 07:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration