Hi all,
I am stumped by an error while trying to install mysql-python. The build and installation go smoothly but when I attempt to import MySQLdb in python I get the following error:
Python 2.4.4 (#1, Jul 13 2007, 06:26:34) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.pyc, but /Users/dreed/MySQL-python-1.2.2 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "MySQLdb/init.py", line 19, in ?
import _mysql
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 7, in ?
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 6, in bootstrap
ImportError: Inappropriate file type for dynamic loading
MaccaM posted a similar error on May 10th but I see no replies in the thread. Any suggestions? System profile and build/installation output below....
System:
Mac OS X 10.4.10
XCode 2.4
$ gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python2.4
Python 2.4.4 (#1, Jul 13 2007, 06:26:34) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
$ mysql --version
/usr/local/mysql/bin/mysql Ver 14.12 Distrib 5.0.41, for apple-darwin8.5.1 (i686) using readline 5.0
Hardware:
Model Name: Mac Pro
Model Identifier: MacPro1,1
Processor Name: Dual-Core Intel Xeon
Processor Speed: 3 GHz
Number Of Processors: 2
Total Number Of Cores: 4
L2 Cache (per processor): 4 MB
Memory: 4 GB
Bus Speed: 1.33 GHz
Boot ROM Version: MP11.005C.B04
$ sudo python2.4 setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-ppc/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
running build_ext
creating build/bdist.macosx-10.3-ppc
creating build/bdist.macosx-10.3-ppc/egg
copying build/lib.macosx-10.3-ppc-2.4/_mysql.so -> build/bdist.macosx-10.3-ppc/egg
copying build/lib.macosx-10.3-ppc-2.4/_mysql_exceptions.py -> build/bdist.macosx-10.3-ppc/egg
creating build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/init.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/connections.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
creating build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/init.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/CLIENT.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/CR.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/ER.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/FLAG.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/REFRESH.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/converters.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/cursors.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/release.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/times.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
byte-compiling build/bdist.macosx-10.3-ppc/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/init.py to init.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/connections.py to connections.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/init.py to init.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/CR.py to CR.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/ER.py to ER.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/converters.py to converters.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/cursors.py to cursors.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/release.py to release.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/times.py to times.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.macosx-10.3-ppc/egg/_mysql.py to _mysql.pyc
creating build/bdist.macosx-10.3-ppc/egg/EGG-INFO
writing MySQL_python.egg-info/native_libs.txt
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/native_libs.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg' and adding 'build/bdist.macosx-10.3-ppc/egg' to it
removing 'build/bdist.macosx-10.3-ppc/egg' (and everything under it)
Processing MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg
Removing /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg
Copying MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg to /usr/local/lib/python2.4/site-packages
MySQL-python 1.2.2 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg
Processing dependencies for MySQL-python==1.2.2
$ python2.4
Python 2.4.4 (#1, Jul 13 2007, 06:26:34) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.pyc, but /Users/dreed/MySQL-python-1.2.2 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "MySQLdb/init.py", line 19, in ?
import _mysql
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 7, in ?
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 6, in bootstrap
ImportError: Inappropriate file type for dynamic loading
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I am stumped by an error while trying to install mysql-python. The build and installation go smoothly but when I attempt to import MySQLdb in python I get the following error:
Python 2.4.4 (#1, Jul 13 2007, 06:26:34)
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.pyc, but /Users/dreed/MySQL-python-1.2.2 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "MySQLdb/init.py", line 19, in ?
import _mysql
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 7, in ?
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 6, in bootstrap
ImportError: Inappropriate file type for dynamic loading
MaccaM posted a similar error on May 10th but I see no replies in the thread. Any suggestions? System profile and build/installation output below....
System:
Mac OS X 10.4.10
XCode 2.4
$ gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python2.4
Python 2.4.4 (#1, Jul 13 2007, 06:26:34)
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
$ mysql --version
/usr/local/mysql/bin/mysql Ver 14.12 Distrib 5.0.41, for apple-darwin8.5.1 (i686) using readline 5.0
Hardware:
Model Name: Mac Pro
Model Identifier: MacPro1,1
Processor Name: Dual-Core Intel Xeon
Processor Speed: 3 GHz
Number Of Processors: 2
Total Number Of Cores: 4
L2 Cache (per processor): 4 MB
Memory: 4 GB
Bus Speed: 1.33 GHz
Boot ROM Version: MP11.005C.B04
Output form build and installation:
$ python2.4 setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.3-ppc-2.4
copying _mysql_exceptions.py -> build/lib.macosx-10.3-ppc-2.4
creating build/lib.macosx-10.3-ppc-2.4/MySQLdb
copying MySQLdb/init.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
creating build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.3-ppc-2.4
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql/include -I/usr/local/include/python2.4 -c _mysql.c -o build/temp.macosx-10.3-ppc-2.4/_mysql.o -Os -arch i386 -fno-common
gcc -bundle -undefined dynamic_lookup build/temp.macosx-10.3-ppc-2.4/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -o build/lib.macosx-10.3-ppc-2.4/_mysql.so
$ sudo python2.4 setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-ppc/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
running build_ext
creating build/bdist.macosx-10.3-ppc
creating build/bdist.macosx-10.3-ppc/egg
copying build/lib.macosx-10.3-ppc-2.4/_mysql.so -> build/bdist.macosx-10.3-ppc/egg
copying build/lib.macosx-10.3-ppc-2.4/_mysql_exceptions.py -> build/bdist.macosx-10.3-ppc/egg
creating build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/init.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/connections.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
creating build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/init.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/CLIENT.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/CR.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/ER.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/FLAG.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/constants/REFRESH.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/converters.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/cursors.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/release.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
copying build/lib.macosx-10.3-ppc-2.4/MySQLdb/times.py -> build/bdist.macosx-10.3-ppc/egg/MySQLdb
byte-compiling build/bdist.macosx-10.3-ppc/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/init.py to init.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/connections.py to connections.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/init.py to init.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/CR.py to CR.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/ER.py to ER.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/converters.py to converters.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/cursors.py to cursors.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/release.py to release.pyc
byte-compiling build/bdist.macosx-10.3-ppc/egg/MySQLdb/times.py to times.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.macosx-10.3-ppc/egg/_mysql.py to _mysql.pyc
creating build/bdist.macosx-10.3-ppc/egg/EGG-INFO
writing MySQL_python.egg-info/native_libs.txt
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/native_libs.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.3-ppc/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg' and adding 'build/bdist.macosx-10.3-ppc/egg' to it
removing 'build/bdist.macosx-10.3-ppc/egg' (and everything under it)
Processing MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg
Removing /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg
Copying MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg to /usr/local/lib/python2.4/site-packages
MySQL-python 1.2.2 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg
Processing dependencies for MySQL-python==1.2.2
$ python2.4
Python 2.4.4 (#1, Jul 13 2007, 06:26:34)
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-macosx-10.3-ppc.egg/_mysql.pyc, but /Users/dreed/MySQL-python-1.2.2 is being added to sys.path
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "MySQLdb/init.py", line 19, in ?
import _mysql
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 7, in ?
File "build/bdist.macosx-10.3-ppc/egg/_mysql.py", line 6, in bootstrap
ImportError: Inappropriate file type for dynamic loading