我正在使用anaconda的python 2.7发行版作为我的默认python发行版。我收到了
Fatal Python error: PyThreadState_Get: no current thread
这个错误似乎是python发布冲突的结果;我正在使用anconda的python发行版,但Leap motion的sdk预计默认的mac发行版。
我按照changing the default python distribution跟踪了Leap motion的sdk说明如下,
install_name_tool -change /Library/Frameworks/Python.framework/Versions/2.7/Python
//anaconda/bin/python LeapPython.so
但现在我收到以下错误,我无法做多,
Traceback (most recent call last):
File "Sample.py", line 9, in <module>
import Leap, sys, thread, time
File "/Users/jkarimi91/Documents/Projects/hackingedu/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/Leap.py", line 28, in <module>
LeapPython = swig_import_helper()
File "/Users/jkarimi91/Documents/Projects/hackingedu/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/Leap.py", line 24, in swig_import_helper
_mod = imp.load_module('LeapPython', fp, pathname, description)
ImportError: dlopen(/Users/jkarimi91/Documents/Projects/hackingedu/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/LeapPython.so, 2): Library not loaded: //anaconda/bin/python
Referenced from: /Users/jkarimi91/Documents/Projects/hackingedu/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/LeapPython.so
Reason: no suitable image found. Did find:
//anaconda/bin/python: can't map unslidable segment __TEXT to 0x100000000 with size 0x1000
答案 0 :(得分:0)
我认为问题在于您正在尝试加载Python可执行文件,而不是共享库。由于Anaconda似乎没有为您提供框架,因此请尝试使用/anaconda/bin/python
替换命令中的/anaconda/pkgs/python-2.7.10.0
,或者如果这不起作用,请指定Python dylib /anaconda/pkgs/python-2.7.10.0/lib/libpython2.7.dylib
的完整路径。