我刚刚通过 pip (1.5) 将 celery 更新到最新版本 (3.1.7),但我遇到了一个致命异常,我在尝试导入库时无法理解。通过运行:
from celery import Celery
在我得到的 shell 中:
File "<console>", line 1, in <module>
File "/Users/davidezanotti/CygoraPythonEnv/lib/python2.7/site-packages/celery/__init__.py", line 130, in <module>
from .five import recreate_module
File "/Users/davidezanotti/CygoraPythonEnv/lib/python2.7/site-packages/celery/five.py", line 51, in <module>
from kombu.five import monotonic
File "/Users/davidezanotti/CygoraPythonEnv/lib/python2.7/site-packages/kombu/five.py", line 47, in <module>
libSystem = ctypes.CDLL('libSystem.dylib')
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libSystem.dylib, 6): image not found
我在 OS X 10.8.5 上使用带有 VirtualEnv 和 macports 的 python 2.7.6
我知道问题是缺少底层依赖项(“libSystem.dylib”),但我不知道如何解决这个问题
(在/usr/lib/下我可以在我的机器上找到 libSystem.dylib)
最佳答案
只需将/usr/lib 添加到 DYLD_FALLBACK_LIBRARY_PATH 即可解决此问题。
关于python - "OSError: dlopen(libSystem.dylib, 6): image not found"(OS X + macports + celery 3.1.7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20915752/