我使用anaconda的python2.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
发布于 2015-10-27 04:04:49
我认为问题在于您试图加载的是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的完整路径。
https://stackoverflow.com/questions/33323492
复制相似问题