Python程序在/ Library中寻找不存在的2.7版Python框架....但它位于/ System / Library中

时间:2016-07-16 21:17:16

标签: python python-2.7

我运行了一个程序并收到以下错误:

samples$ python Sample.py
Traceback (most recent call last):
  File "Sample.py", line 9, in <module>
    import Leap, sys, thread, time
  File "/Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/Leap.py", line 28, in <module>
    LeapPython = swig_import_helper()
  File "/Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/Leap.py", line 24, in swig_import_helper
    _mod = imp.load_module('LeapPython', fp, pathname, description)
ImportError: dlopen(/Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/LeapPython.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/2.7/Python
  Referenced from: /Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/LeapPython.so
  Reason: image not found

/Library/Frameworks/Python.framework/Versions/中,有一个3.4版本,但不是2.7,这是程序想要的。 /System/Library/Frameworks/Python.framework/Versions/

中有2.7

这是LeapMotion SDK的示例文件

  • 为什么/ Library / ...文件夹中没有2.7版本?
  • 我应该以某种方式安装它吗?我已经安装了3.4和2.7.11 with homebrew
  • 我应该从其他文件夹创建符号链接吗?

为什么会这样?

1 个答案:

答案 0 :(得分:0)

在macOS上,创建注释中提到的@Peter的Symlink:

sudo ln -s /System/Library/Frameworks/Python.framework / Library / Frameworks