Necesito acceder al Bluetooth desde Python. He intentado instalar lightblue a través de easy_install. Se instala correctamente, pero cuando intento importarlo falla.
User@Mac:codes$ python
Python 2.7.5 (default, Sep 24 2013, 20:58:05)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lightblue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
from _lightblue import *
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_lightblue.py", line 23, in <module>
import Foundation
ImportError: No module named Foundation
Eso significa que el módulo llamado "Foundation" no existe o que Python no lo encuentra. Seguí investigando y encontré este . He seguido las instrucciones:
User@Mac:codes$ export PYTHONPATH="/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/"
Y lo intentó de nuevo:
Python 2.7.5 (default, Sep 24 2013, 20:58:05)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lightblue
Y conseguí esto:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
from _lightblue import *
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_lightblue.py", line 28, in <module>
import _LightAquaBlue
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lightblue/_LightAquaBlue.py", line 32, in <module>
_FRAMEWORK_PATH)
ImportError: Cannot load LightAquaBlue framework, not found at/Library/Frameworks/LightAquaBlue.framework
Y he intentado instalar Python desde http://www.Python.org . ¿Qué más puedo hacer?