0

我正在将 Zope 2 的旧安装移动到新的 Mac OS 10.8 服务器。不幸的是,我们的服务器需要 Python 2.4 才能运行,所以我安装了 MacPorts 版本。服务器加载正常,直到它尝试加载 MySQL-python 模块,此时它以ImportError

Traceback (most recent call last):
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Zope2/Startup/run.py", line 56, in ?
    run()
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Zope2/Startup/run.py", line 21, in run
    starter.prepare()
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Zope2/Startup/__init__.py", line 98, in prepare
    self.startZope()
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Zope2/Startup/__init__.py", line 257, in startZope
    Zope2.startup()
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Zope2/App/startup.py", line 45, in startup
    OFS.Application.import_products()
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/OFS/Application.py", line 675, in import_products
    import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/OFS/Application.py", line 698, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Products/ZMySQLDA/__init__.py", line 91, in ?
    import DA
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Products/ZMySQLDA/DA.py", line 92, in ?
    from db import DB
  File "/home/zope/envLRC/Zope.2.8.6/lib/python/Products/ZMySQLDA/db.py", line 89, in ?
    import _mysql
  File "build/bdist.macosx-10.8-x86_64/egg/_mysql.py", line 7, in ?
  File "build/bdist.macosx-10.8-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading

服务器在 virtualenv 中运行,以确保使用 Python 2.4。谁能向我解释为什么会产生这个错误以及应该怎么做?谢谢!

4

1 回答 1

0

看起来像是安装/创建的东西_mysql.py,你应该有一个_mysql.so. 如果您有.so,请尝试重命名_mysql.py文件并重新启动。

于 2013-04-03T06:32:25.433 回答