“OSError:dlopen(libSystem.dylib,6):找不到映像”(OS X+macports+芹菜3.1.7)

2024-05-20 08:01:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚通过pip(1.5)将芹菜更新到了最新版本(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

我在OSX10.8.5上使用Python2.7.6和VirtualEnv和macports

我知道问题是缺少底层依赖项(“libSystem.dylib”),但我不知道如何解决这个问题

(在/usr/lib/I下可以在我的机器上找到libSystem.dylib)


Tags: infrompyimportliblineusersfile
2条回答

只需将/usr/lib添加到DYLD_FALLBACK_LIBRARY_PATH即可解决此问题。

问题是,我在我的bash配置文件中定义了一个DYLD_FALLBACK_LIBRARY_PATH,方法是按照postgis上Django文档中关于macports的注释进行操作:https://docs.djangoproject.com/en/1.6/ref/contrib/gis/install/#macports

但这会导致我所面对的那种出人意料的行为,不管怎么说,通过评论,一切似乎都奏效了!

相关问题 更多 >