After what looked like a successful build and install on Mac OSx. Snow Leopard I get the following error. Any ideas why?
import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/init.py", line 19, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in bootstrap
ImportError: dynamic module does not define init function (init_mysql)
Found this post on http://www.davidcramer.net/code/57/mysqldb-on- leopard.html and removing the directories below fixed my import problem:
Begin of post by user muanis
I've got the same problem.
Running mysql 5.1.35. After discovering that I should change to 32 bit version, repeated all the steps and got the same error about the init function.
import sys, pkg_resources, imp
File "", line 1, in
File "MySQLdb/init.py", line 19, in
import _mysql
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in bootstrap
After a couple of hours debugging I noticed that the dist and build dirs of MySQLdb 1.2.2 were not removed when I issue a python setup.py clean.
I manually removed both of them and got everything working fine.
Log in to post a comment.
After what looked like a successful build and install on Mac OSx. Snow Leopard
I get the following error. Any ideas why?
import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/init.py", line 19, in
<module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in
bootstrap
ImportError: dynamic module does not define init function (init_mysql)
Found this post on http://www.davidcramer.net/code/57/mysqldb-on-
leopard.html and
removing the directories below fixed my import problem:
I've got the same problem.
Running mysql 5.1.35. After discovering that I should change to 32 bit
version, repeated all the steps and got the same error about the init
function.
import sys, pkg_resources, imp
Traceback (most recent call last):
File "", line 1, in
File "MySQLdb/init.py", line 19, in
import _mysql
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in bootstrap
ImportError: dynamic module does not define init function (init_mysql)
After a couple of hours debugging I noticed that the dist and build dirs of
MySQLdb 1.2.2 were not removed when I issue a python setup.py clean.
I manually removed both of them and got everything working fine.