By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,812 Members | 1,288 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,812 IT Pros & Developers. It's quick & easy.

MySQLdb installed, won't connect on OSX

P: n/a
Greetings,

I am attempting to get MySQLdb 0.9.2 installed on Mac OS 10.2 with a
Fink distribution of Python 2.2.2. I have seen only a few posts on the
subject, some of them relate to "conflicting header files," but I don't
know what to do about conflicting header files, or where I would find
them, and once I found them, which ones to remove.

I have compiled MySQL 4.1 and installed into /usr/local/mysql, but
since have moved to a Fink package installation or 4.0.13. Although
MySQLdb appears to install successfully (I think), I am unable to
connect when I try, as shown below:
import sys
import MySQLdb
conn = MySQLdb.connect (db = 'mydb', host = 'localhost', user = 'myuser', passwd = 'mypassword')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/sw/lib/python2.2/site-packages/MySQLdb/__init__.py", line 63,
in Connect
return apply(Connection, args, kwargs)
File "/sw/lib/python2.2/site-packages/MySQLdb/connections.py", line
116, in __init__
self.converter[types.StringType] = self.string_literal
TypeError: object does not support item assignment


My setup.py file contains the following (although I've tried many
variations, commenting and uncommenting stuff with no real success):

# include files and library locations should cover most platforms
include_dirs = [
# '/usr/include/mysql',
# '/usr/local/include/mysql',
# '/usr/local/mysql/include/mysql',
'/sw/include/mysql'
]
library_dirs = [
# '/usr/lib/mysql',
# '/usr/local/lib/mysql',
# '/usr/local/mysql/lib/mysql',
'/sw/lib/mysql', '/sw/lib'
]

This is what happens when I build:

running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
skipping '_mysql' extension (up-to-date)

And when I run setup.py install:

running install
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
skipping '_mysql' extension (up-to-date)
running install_lib
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/_mysql.so (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/_mysql_exceptions.py (output
up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/CompatMysqldb.py
(output up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/__init__.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/connections.py (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/__init__.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/CLIENT.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/CR.py (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/ER.py (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/FIELD_TYPE.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/FLAG.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/REFRESH.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/converters.py (output
up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/cursors.py
(output up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/sets.py
(output up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/times.py
(output up-to-date)
skipping byte-compilation of
/sw/lib/python2.2/site-packages/_mysql_exceptions.py to
_mysql_exceptions.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/CompatMysqldb.py to CompatMysqldb.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/__init__.py to __init__.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/connections.py to
connections.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/__init__.py to
__init__.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/CLIENT.py to
CLIENT.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/CR.py to CR.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/ER.py to ER.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/FIELD_TYPE.py to
FIELD_TYPE.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/FLAG.py to FLAG.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/REFRESH.py to
REFRESH.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/converters.py to converters.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/cursors.py to cursors.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/sets.py to sets.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/times.py to times.pyc
Any help would be greatly appreciated.

Thanks,

Peter
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Peter Nikolaidis fed this fish to the penguins on Thursday 25 September
2003 05:05 am:
This is what happens when I build:

running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
skipping '_mysql' extension (up-to-date)

And when I run setup.py install:

running install
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
<snip>

Well, my first thoughts would be to remove the destinations files, so
that the build/install doesn't find "up-to-date" versions of files...
Then force a build of everything...
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.