OSError:dlopen(libSystem。dylib, 6):图像未找到。

时间:2022-02-19 22:03:42

Just updated my Mac to El Capitan 10.11. I am trying to run Django 1.6 with Celery 3.1 and I'm getting this error now:

刚刚更新了我的Mac到El Capitan 10.11。我试着用芹菜1。3来运行Django 1.6我现在得到了这个错误

Unhandled exception in thread started by <function wrapper at 0x10f861050>
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 93, in wrapper
    fn(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 101, in inner_run
    self.validate(display_num_errors=True)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/Library/Python/2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 75, in _populate
    self.load_app(app_name, True)
  File "/Library/Python/2.7/site-packages/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Library/Python/2.7/site-packages/debug_toolbar/models.py", line 9, in <module>
    dt_settings.patch_all()
  File "/Library/Python/2.7/site-packages/debug_toolbar/settings.py", line 215, in patch_all
    patch_root_urlconf()
  File "/Library/Python/2.7/site-packages/debug_toolbar/settings.py", line 203, in patch_root_urlconf
    reverse('djdt:render_panel')
  File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py", line 503, in reverse
    app_list = resolver.app_dict[ns]
  File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py", line 329, in app_dict
    self._populate()
  File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py", line 267, in _populate
    for pattern in reversed(self.url_patterns):
  File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py", line 365, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Library/Python/2.7/site-packages/django/core/urlresolvers.py", line 360, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/pedrotorres/Documents/work/projects/bparts/netpecasv2/urls.py", line 10, in <module>
    url(r'', include('Common.urls')),
  File "/Library/Python/2.7/site-packages/django/conf/urls/__init__.py", line 26, in include
    urlconf_module = import_module(urlconf_module)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/pedrotorres/Documents/work/projects/bparts/Common/urls.py", line 3, in <module>
    from APIMobile.views import request_product_info_by_qrcode
  File "/Users/pedrotorres/Documents/work/projects/bparts/APIMobile/views.py", line 9, in <module>
    from Common.views import resizeImage, token_generator, getWatermarkImage, filterProductsByBrandModelVersionYear, \
  File "/Users/pedrotorres/Documents/work/projects/bparts/Common/views.py", line 34, in <module>
    from Common.tasks import turn_off_demo_mode_new_workshop
  File "/Users/pedrotorres/Documents/work/projects/bparts/Common/tasks.py", line 3, in <module>
    from netpecasv2.celeryapp import app
  File "/Users/pedrotorres/Documents/work/projects/bparts/netpecasv2/celeryapp.py", line 5, in <module>
    from celery import Celery
  File "/Library/Python/2.7/site-packages/celery/__init__.py", line 130, in <module>
    from celery import five
  File "/Library/Python/2.7/site-packages/celery/five.py", line 51, in <module>
    from kombu.five import monotonic
  File "/Library/Python/2.7/site-packages/kombu/five.py", line 52, in <module>
    libSystem = ctypes.CDLL('libSystem.dylib')
  File "/System/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

Everything worked fine before. Can't find a solution to fix this. I've seen this thread but doesn't work: "OSError: dlopen(libSystem.dylib, 6): image not found" (OS X + macports + Celery 3.1.7)

一切工作正常。找不到解决这个问题的办法。我看到过这个线程,但不起作用:“OSError: dlopen(libSystem)。dylib, 6):图像未被发现”(OS X + macports +芹菜3.1.7)

I didn't have any DYLD_FALLBACK_LIBRARY_PATH before. I tried to:

我以前没有任何DYLD_FALLBACK_LIBRARY_PATH。我想:

export DYLD_FALLBACK_LIBRARY_PATH="/usr/lib":$DYLD_FALLBACK_LIBRARY_PATH

but Python can't find the Library despite it being located under "/usr/lib"

但是,尽管Python位于“/usr/lib”下,但它仍然无法找到该库

Anyone has had a problem like this?

有人有过这样的问题吗?

8 个解决方案

#1


12  

I suspect (but can't confirm) the System Integrity Protection (SIP) of OSX El Capitan is preventing access to your /usr/lib folder.

我怀疑(但无法确认)OSX El Capitan的系统完整性保护(SIP)阻止访问您的/usr/lib文件夹。

It would be extreme and defeating the purpose of the security feature, but you could try disabling SIP by booting into the OS X Recovery partition, executing csrutil disable and rebooting...atleast until another option / work-around can be found.

这将是极端的,并且会破坏安全特性的目的,但是您可以尝试通过引导到OS X恢复分区、执行csrutil禁用和重新启动来禁用SIP。至少在找到另一个选择/工作之前。

ArsTechnica has a write-up here: http://arstechnica.com/apple/2015/09/os-x-10-11-el-capitan-the-ars-technica-review/9/

ArsTechnica在这里写了一篇文章:http://arstechnica.com/apple/2015/09/os-x-10-11-el-capitan-the-a -tech -review/9/。

And a similar issue is described here: http://blog.honekamp.net/blog/2015/09/07/el-cap-and-my-printer/

这里有一个类似的问题:http://blog.honekamp.net/blog/2015/09/07/el- my-printer/。

More discussion on Hacker News here: https://news.ycombinator.com/item?id=10309576

更多关于Hacker News的讨论:https://news.ycombinator.com/item?id=10309576。

#2


9  

pip install --upgrade billiard
pip install --upgrade celery
pip install --upgrade kombu
pip install --upgrade amqp

This should work.

这应该工作。

#3


3  

I uninstall "billiard,celery,kombu,amqp" those four packages. Then reinstall the latest version from github solved this

我卸载了“台球,芹菜,kombu,amqp”这四个包。然后重新安装github上的最新版本解决了这个问题。

#4


2  

I ran into the same issue getting celery to work.

我遇到了同样的问题,让芹菜来工作。

I did some quick tests and here's what I found, but can't quite pin it on a specific cause yet:

我做了一些快速的测试,这是我发现的,但还不能确定具体原因:

a. stock python with ctypes.CDLL("libSystem.dylib") results in the image not found error.

a. stock python with ctypes.CDLL(“libSystem.dylib”)结果在图像中没有发现错误。

b. stock python with ctypes.CDLL("/usr/lib/libSystem.dylib") works

b.股票python与ctypes.CDLL("/usr/lib/libSystem.dylib")工作。

c. virtualenv python with ctypes.CDLL("libSystem.dylib") works

使用ctypes.CDLL(“libSystem.dylib”)的virtualenv python工作。

#5


2  

I also ran into the same problem just after upgrading the OS to OS X El Captain. Disabling SIP does the trick, but if someone is not comfortable doing that updating five.py in few modules in site-packages will help. (I know it's not that nice, but it's OK as long as you know what you're doing)

我也遇到了同样的问题,就在升级操作系统到OS X El机长之后。禁用SIP可以做到这一点,但是如果有人不愿意更新5。在站点包中的几个模块中的py将会有所帮助。(我知道这不是很好,但只要你知道自己在做什么就可以了)

Update the places that access the DLL to have absolute path in following modules

更新访问DLL的位置,使其在以下模块中具有绝对路径。

line 145 of site-packages/amqp/five.py 
line 52 of site-packages/kombu/five.py 
line 42 of site-packages/billiard/five.py 

update to:

更新:

libSystem = ctypes.CDLL('libSystem.dylib') => libSystem = ctypes.CDLL('/usr/lib/libSystem.dylib')

hope this helps ;)

希望这有助于;)

#6


0  

Reinstalling python solved the issue for me. Using brew you can just brew install python again. If it says that you need permission to write to /usr/local, try to change permissions by sudo chown -R $(whoami):admin /usr/local, and then install python.

重新安装python解决了我的问题。使用brew,您可以再一次酝酿安装python。如果它说您需要允许写入/usr/local,尝试更改sudo chown -R $(whoami)的权限:admin /usr/local,然后安装python。

#7


0  

I tried updating to the latest versions of these libraries from github, but it did not help. The simplest solution that I've found is to use virtualenv

我尝试从github上更新这些库的最新版本,但是没有帮助。我找到的最简单的解决方案是使用virtualenv。

virtualenv myenv
cd myenv
source bin/activate
pip install celery

To confirm it worked:

确认工作:

python -c "import celery"

This seems preferable to disabling a fundamental security feature of the OS, and virtualenv has its own (well documented) benefits.

这似乎比禁用操作系统的基本安全特性更可取,virtualenv也有它自己的(有记录的)好处。

#8


0  

You can delete the current celery version, and then download it from the http://pypi.python.org/pypi/celery/, build and install the sorce code.It is helpful for me, and I hope so do you.

您可以删除当前的芹菜版本,然后从http://pypi.python.org/pypi/celery/中下载,构建并安装sorce代码。这对我很有帮助,我希望你也是。

#1


12  

I suspect (but can't confirm) the System Integrity Protection (SIP) of OSX El Capitan is preventing access to your /usr/lib folder.

我怀疑(但无法确认)OSX El Capitan的系统完整性保护(SIP)阻止访问您的/usr/lib文件夹。

It would be extreme and defeating the purpose of the security feature, but you could try disabling SIP by booting into the OS X Recovery partition, executing csrutil disable and rebooting...atleast until another option / work-around can be found.

这将是极端的,并且会破坏安全特性的目的,但是您可以尝试通过引导到OS X恢复分区、执行csrutil禁用和重新启动来禁用SIP。至少在找到另一个选择/工作之前。

ArsTechnica has a write-up here: http://arstechnica.com/apple/2015/09/os-x-10-11-el-capitan-the-ars-technica-review/9/

ArsTechnica在这里写了一篇文章:http://arstechnica.com/apple/2015/09/os-x-10-11-el-capitan-the-a -tech -review/9/。

And a similar issue is described here: http://blog.honekamp.net/blog/2015/09/07/el-cap-and-my-printer/

这里有一个类似的问题:http://blog.honekamp.net/blog/2015/09/07/el- my-printer/。

More discussion on Hacker News here: https://news.ycombinator.com/item?id=10309576

更多关于Hacker News的讨论:https://news.ycombinator.com/item?id=10309576。

#2


9  

pip install --upgrade billiard
pip install --upgrade celery
pip install --upgrade kombu
pip install --upgrade amqp

This should work.

这应该工作。

#3


3  

I uninstall "billiard,celery,kombu,amqp" those four packages. Then reinstall the latest version from github solved this

我卸载了“台球,芹菜,kombu,amqp”这四个包。然后重新安装github上的最新版本解决了这个问题。

#4


2  

I ran into the same issue getting celery to work.

我遇到了同样的问题,让芹菜来工作。

I did some quick tests and here's what I found, but can't quite pin it on a specific cause yet:

我做了一些快速的测试,这是我发现的,但还不能确定具体原因:

a. stock python with ctypes.CDLL("libSystem.dylib") results in the image not found error.

a. stock python with ctypes.CDLL(“libSystem.dylib”)结果在图像中没有发现错误。

b. stock python with ctypes.CDLL("/usr/lib/libSystem.dylib") works

b.股票python与ctypes.CDLL("/usr/lib/libSystem.dylib")工作。

c. virtualenv python with ctypes.CDLL("libSystem.dylib") works

使用ctypes.CDLL(“libSystem.dylib”)的virtualenv python工作。

#5


2  

I also ran into the same problem just after upgrading the OS to OS X El Captain. Disabling SIP does the trick, but if someone is not comfortable doing that updating five.py in few modules in site-packages will help. (I know it's not that nice, but it's OK as long as you know what you're doing)

我也遇到了同样的问题,就在升级操作系统到OS X El机长之后。禁用SIP可以做到这一点,但是如果有人不愿意更新5。在站点包中的几个模块中的py将会有所帮助。(我知道这不是很好,但只要你知道自己在做什么就可以了)

Update the places that access the DLL to have absolute path in following modules

更新访问DLL的位置,使其在以下模块中具有绝对路径。

line 145 of site-packages/amqp/five.py 
line 52 of site-packages/kombu/five.py 
line 42 of site-packages/billiard/five.py 

update to:

更新:

libSystem = ctypes.CDLL('libSystem.dylib') => libSystem = ctypes.CDLL('/usr/lib/libSystem.dylib')

hope this helps ;)

希望这有助于;)

#6


0  

Reinstalling python solved the issue for me. Using brew you can just brew install python again. If it says that you need permission to write to /usr/local, try to change permissions by sudo chown -R $(whoami):admin /usr/local, and then install python.

重新安装python解决了我的问题。使用brew,您可以再一次酝酿安装python。如果它说您需要允许写入/usr/local,尝试更改sudo chown -R $(whoami)的权限:admin /usr/local,然后安装python。

#7


0  

I tried updating to the latest versions of these libraries from github, but it did not help. The simplest solution that I've found is to use virtualenv

我尝试从github上更新这些库的最新版本,但是没有帮助。我找到的最简单的解决方案是使用virtualenv。

virtualenv myenv
cd myenv
source bin/activate
pip install celery

To confirm it worked:

确认工作:

python -c "import celery"

This seems preferable to disabling a fundamental security feature of the OS, and virtualenv has its own (well documented) benefits.

这似乎比禁用操作系统的基本安全特性更可取,virtualenv也有它自己的(有记录的)好处。

#8


0  

You can delete the current celery version, and then download it from the http://pypi.python.org/pypi/celery/, build and install the sorce code.It is helpful for me, and I hope so do you.

您可以删除当前的芹菜版本,然后从http://pypi.python.org/pypi/celery/中下载,构建并安装sorce代码。这对我很有帮助,我希望你也是。