尝试在 OS X 10.9.5 上使用 python 中的 Celery 时出现一个奇怪的错误。这曾经可以工作,但现在(显然)在导入 kombu.five 时无法使用某些 C 库。
~$ 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
我正在使用 python 2.7.8(通过安装brew install python
)和最新版本的 celery 和 kombu(通过安装pip install celery
)。有什么提示吗?
这是我的输出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
以下是有关 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