简体   繁体   中英

Runtime error with kombu on Mac OS 10.9.5

I get a strange error when trying to use Celery from python on OS X 10.9.5. This used to work, but it's now (apparently) failing to use some C library when importing kombu.five.

~$ python
Python 2.7.8 (default, Aug 24 2014, 21:26:19)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import celery
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/celery/__init__.py", line 130, in <module>
    from celery import five
  File "/usr/local/lib/python2.7/site-packages/celery/five.py", line 51, in <module>
    from kombu.five import monotonic
  File "/usr/local/lib/python2.7/site-packages/kombu/five.py", line 52, in <module>
    absolute_to_nanoseconds = CoreServices.AbsoluteToNanoseconds
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, AbsoluteToNanoseconds): symbol not found

I am using python 2.7.8 (installed via brew install python ) and the latest versions of celery and kombu (installed via pip install celery ). Any hint?

Here is my output of brew --config :

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: c32db7bdaaedbf94d070ac13c1f8c42bd79c3853
Last commit: 51 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.9.5-x86_64
Xcode: 6.0.1
CLT: 6.0.0.0.1.1410400753
Clang: 6.0 build 600
X11: 2.7.6 => /opt/X11
System Ruby: 2.0.0-481
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7

Here is some more output regarding ctypes:

>>> import ctypes, ctypes.util
>>> CoreServices = ctypes.CDLL(ctypes.util.find_library('CoreServices'))
>>> print CoreServices
<CDLL 'None', handle fffffffffffffffe at 10eac1e50>
>>> print CoreServices.AbsoluteToNanoseconds
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, AbsoluteToNanoseconds): symbol not found

Found it, thanks TimSmith! It was a conflict in the DYLD_FALLBACK_LIBRARY_PATH environment variable between the libraries used by Homebrew Python and Paraview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM