Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I need to access Bluetooth from Python. I have tried installing lightblue via easy_install. It installs properly, but when I try to import it it fails.

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

That means module called "Foundation" does not exist or python cannot find it. I continued my research and found this. I followed the instructions:

User@Mac:codes$ export PYTHONPATH="/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/"

And tried again:

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

And got this:

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

And I tried installing python from http://www.python.org. What can I do anymore?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.