Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)
Hello Chetan, Well thank you very much! I must be very tired to forget to compile MySQL without --enable-thread-safe-client !!! It seems that MySQL-python now compiles with a warning: ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file is not of required architecture But when I try to import _mysql in Python 2.4.4 shell it seems to import the module with no errors. After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I receive the following error: =============================== 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 102, in prepare self.startZope() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 278, in startZope Zope2.startup() File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line 45, in startup OFS.Application.import_products() File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 686, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading =============================== Any ideas? ps: I'm posting this to zope list because I'm sure there is more people with this problem. tia Hugo On Feb 20, 2008 10:35 AM, Chetan Kumar <chetan.mlist@gmail.com> wrote:
Hello I understand. If I could take the risk of "telling-the-obvious" what you need to do is to recompile mysql so that mysqlclient_r libraries are also created. --enable-thread-safe-client is to be used while configuring the mysql installation. If that is done already, the LD_LIBRARY_PATH (or equivalent in your case) if to set appropriately so that lmysqlclient_r is available for linking. Good luck Chetan
-- Hugo Ramos - ramosh@gmail.com IT Project Manager ~~~~~~~~~~~~~~ @ ~~~~~~~~~~~~~~ http://www.orkut.com/Profile.aspx?uid=10082105466310142690 http://otuggapoesia.blogspot.com/ http://otugga.blogspot.com/
Well, I went googling for this error... Google gives 1 (one) answer!!! The worst part is that it's related to django and mod_python. I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger). omg... Thanks Hugo On Feb 20, 2008 12:31 PM, Hugo Ramos <ramosh@gmail.com> wrote:
Hello Chetan,
Well thank you very much! I must be very tired to forget to compile MySQL without --enable-thread-safe-client !!! It seems that MySQL-python now compiles with a warning:
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file is not of required architecture
But when I try to import _mysql in Python 2.4.4 shell it seems to import the module with no errors.
After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I receive the following error:
=============================== 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 102, in prepare self.startZope() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 278, in startZope Zope2.startup() File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line 45, in startup OFS.Application.import_products() File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 686, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading ===============================
Any ideas?
ps: I'm posting this to zope list because I'm sure there is more people with this problem.
tia
Hugo
On Feb 20, 2008 10:35 AM, Chetan Kumar <chetan.mlist@gmail.com> wrote:
Hello I understand. If I could take the risk of "telling-the-obvious" what you need to do is to recompile mysql so that mysqlclient_r libraries are also created. --enable-thread-safe-client is to be used while configuring the mysql installation. If that is done already, the LD_LIBRARY_PATH (or equivalent in your case) if to set appropriately so that lmysqlclient_r is available for linking. Good luck Chetan
-- Hugo Ramos - ramosh@gmail.com IT Project Manager
~~~~~~~~~~~~~~ @ ~~~~~~~~~~~~~~ http://www.orkut.com/Profile.aspx?uid=10082105466310142690 http://otuggapoesia.blogspot.com/ http://otugga.blogspot.com/
-- Hugo Ramos - ramosh@gmail.com IT Project Manager ~~~~~~~~~~~~~~ @ ~~~~~~~~~~~~~~ http://www.orkut.com/Profile.aspx?uid=10082105466310142690 http://otuggapoesia.blogspot.com/ http://otugga.blogspot.com/
Hugo Ramos wrote:
Well,
I went googling for this error... Google gives 1 (one) answer!!! The worst part is that it's related to django and mod_python.
I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).
You could also forward to Postgres :-) Unless you have a very specific need for mysql... Regards Tino
Hi Tino, Is "I've never used Postgres before and all my web life experience is MySQL based" reason enough? :-) Thanks Hugo On Thu, Feb 21, 2008 at 3:31 PM, Tino Wildenhain <tino@wildenhain.de> wrote:
Hugo Ramos wrote:
Well,
I went googling for this error... Google gives 1 (one) answer!!! The worst part is that it's related to django and mod_python.
I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).
You could also forward to Postgres :-) Unless you have a very specific need for mysql...
Regards Tino
Hi Hugo. I believe 'file is not of required architecture' may be the clue here. Ever since mac went to universal binaries, folks with ppc have been having trouble since it is compiled with i386 arch flags and vice versa for folks with intel macs (with ppc arch flags). The only way to get around this is to compile a universal build, use universal binaries, or build for your own architecture. There is a large amount of software out there that does not do the right thing. For myself, I build my own software including python and I try and keep away from the universal insanity. On a mac, many folks use macports without the universal build. If you choose to build your own software, you can place it in the /opt directory to prevent it from affecting your system software. This is where your macports software will go if you use it. You will also need to modify your path to ensure that your compiled software is obtained over system software. I see that your issue was solved with a universal build. This probably just confirms what I have written. This may be alright until you run into the next snag with something else you need to compile. Personally, I got tired of the consistent problems trying to build software with the universal python. Regards, David Hugo Ramos wrote:
Hello Chetan,
Well thank you very much! I must be very tired to forget to compile MySQL without --enable-thread-safe-client !!! It seems that MySQL-python now compiles with a warning:
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file is not of required architecture
But when I try to import _mysql in Python 2.4.4 shell it seems to import the module with no errors.
After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I receive the following error:
=============================== 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 102, in prepare self.startZope() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 278, in startZope Zope2.startup() File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line 45, in startup OFS.Application.import_products() File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 686, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading ===============================
Any ideas?
ps: I'm posting this to zope list because I'm sure there is more people with this problem.
tia
Hugo
On Feb 20, 2008 10:35 AM, Chetan Kumar <chetan.mlist@gmail.com> wrote:
Hello I understand. If I could take the risk of "telling-the-obvious" what you need to do is to recompile mysql so that mysqlclient_r libraries are also created. --enable-thread-safe-client is to be used while configuring the mysql installation. If that is done already, the LD_LIBRARY_PATH (or equivalent in your case) if to set appropriately so that lmysqlclient_r is available for linking. Good luck Chetan
Hello David, It makes sense to me! The only thing I was using as a binary was Python 2.4.4 universal binary. I guess if I was using Python from the source it should work then. Thank you very much. Hugo On Thu, Feb 21, 2008 at 3:01 AM, David Pratt <fairwinds@eastlink.ca> wrote:
Hi Hugo. I believe 'file is not of required architecture' may be the clue here. Ever since mac went to universal binaries, folks with ppc have been having trouble since it is compiled with i386 arch flags and vice versa for folks with intel macs (with ppc arch flags). The only way to get around this is to compile a universal build, use universal binaries, or build for your own architecture. There is a large amount of software out there that does not do the right thing.
For myself, I build my own software including python and I try and keep away from the universal insanity. On a mac, many folks use macports without the universal build. If you choose to build your own software, you can place it in the /opt directory to prevent it from affecting your system software. This is where your macports software will go if you use it. You will also need to modify your path to ensure that your compiled software is obtained over system software.
I see that your issue was solved with a universal build. This probably just confirms what I have written. This may be alright until you run into the next snag with something else you need to compile. Personally, I got tired of the consistent problems trying to build software with the universal python.
Regards, David
Hugo Ramos wrote:
Hello Chetan,
Well thank you very much! I must be very tired to forget to compile MySQL without --enable-thread-safe-client !!! It seems that MySQL-python now compiles with a warning:
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file is not of required architecture
But when I try to import _mysql in Python 2.4.4 shell it seems to import the module with no errors.
After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I receive the following error:
=============================== 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 102, in prepare self.startZope() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 278, in startZope Zope2.startup() File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line 45, in startup OFS.Application.import_products() File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 686, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading ===============================
Any ideas?
ps: I'm posting this to zope list because I'm sure there is more people with this problem.
tia
Hugo
On Feb 20, 2008 10:35 AM, Chetan Kumar <chetan.mlist@gmail.com> wrote:
Hello I understand. If I could take the risk of "telling-the-obvious" what you need to do is to recompile mysql so that mysqlclient_r libraries are also created. --enable-thread-safe-client is to be used while configuring the mysql installation. If that is done already, the LD_LIBRARY_PATH (or equivalent in your case) if to set appropriately so that lmysqlclient_r is available for linking. Good luck Chetan
-- Hugo Ramos - ramosh@gmail.com IT Project Manager ~~~~~~~~~~~~~~ @ ~~~~~~~~~~~~~~ http://www.orkut.com/Profile.aspx?uid=10082105466310142690 http://otuggapoesia.blogspot.com/ http://otugga.blogspot.com/
Hi Hugo. Yes, that's true but of course you have to consider all of the other frameworks that apple has already put on your machine. Much of the problem will come when linking the libraries when compiling. So in fact it is a bigger issue and requires much of the base software to recompiled using macports or on your own for a sound development machine. You can of course recompile these to create a framework build for your own architecture. You probably just need to keep in mind that mac is really only just FreeBSD/Darwin so things will compile in a normal mode without anything 'universal' involved. I just takes some effort. Regards, David Hugo Ramos wrote:
Hello David,
It makes sense to me! The only thing I was using as a binary was Python 2.4.4 universal binary. I guess if I was using Python from the source it should work then.
Thank you very much.
Hugo
On Thu, Feb 21, 2008 at 3:01 AM, David Pratt <fairwinds@eastlink.ca> wrote:
Hi Hugo. I believe 'file is not of required architecture' may be the clue here. Ever since mac went to universal binaries, folks with ppc have been having trouble since it is compiled with i386 arch flags and vice versa for folks with intel macs (with ppc arch flags). The only way to get around this is to compile a universal build, use universal binaries, or build for your own architecture. There is a large amount of software out there that does not do the right thing.
For myself, I build my own software including python and I try and keep away from the universal insanity. On a mac, many folks use macports without the universal build. If you choose to build your own software, you can place it in the /opt directory to prevent it from affecting your system software. This is where your macports software will go if you use it. You will also need to modify your path to ensure that your compiled software is obtained over system software.
I see that your issue was solved with a universal build. This probably just confirms what I have written. This may be alright until you run into the next snag with something else you need to compile. Personally, I got tired of the consistent problems trying to build software with the universal python.
Regards, David
Hugo Ramos wrote:
Hello Chetan,
Well thank you very much! I must be very tired to forget to compile MySQL without --enable-thread-safe-client !!! It seems that MySQL-python now compiles with a warning:
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file is not of required architecture
But when I try to import _mysql in Python 2.4.4 shell it seems to import the module with no errors.
After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I receive the following error:
=============================== 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading Traceback (most recent call last): File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ? run() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run starter.prepare() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 102, in prepare self.startZope() File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py", line 278, in startZope Zope2.startup() File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup _startup() File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line 45, in startup OFS.Application.import_products() File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 686, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line 709, in import_product product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py", line 91, in ? import DA File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ? from db import DB File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ? import _mysql File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ? File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__ ImportError: Inappropriate file type for dynamic loading ===============================
Any ideas?
ps: I'm posting this to zope list because I'm sure there is more people with this problem.
tia
Hugo
On Feb 20, 2008 10:35 AM, Chetan Kumar <chetan.mlist@gmail.com> wrote:
Hello I understand. If I could take the risk of "telling-the-obvious" what you need to do is to recompile mysql so that mysqlclient_r libraries are also created. --enable-thread-safe-client is to be used while configuring the mysql installation. If that is done already, the LD_LIBRARY_PATH (or equivalent in your case) if to set appropriately so that lmysqlclient_r is available for linking. Good luck Chetan
participants (3)
-
David Pratt -
Hugo Ramos -
Tino Wildenhain