简体   繁体   中英

How to install lightblue (bluetooth) module on Snow Leopard?

I'm trying to install the bluetooth module from lightblue .

My system: Mac OS X Snow Leopard 10.6.8, Python 2.7, gcc 4.2 & 4.0, xcode v.3.2.3 . I checked , i also got python 2.3/2.5/2.6 folders directly under /Library/Python/ in my system (This is different from 2.7 which is located in /Library/Frameworks/Python.framework/Versions/2.7/)

When I install lightblue with python setup.py install , I get the following error:

GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file BBBluetoothOBEXClient.m)
** BUILD FAILED **

So I thought it was about the gcc version. So I did: 'export CC=gcc-4.0' or 'export CC=/usr/bin/gcc-4.0' (I got 2 versions of gcc on my Mac; 4.2 and 4.0). Then I checked with gcc -v , it's already switched from 4.2 to 4.0. But when I rerun python setup.py install , it is still showing 4.2:

GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file BBBluetoothOBEXClient.m)
** BUILD FAILED **

Why is it still showing gcc 4.2?

Does anyone have any solution? I tried using pip but got the same result.

I accidentally found the solution, I grabbed this from : lightblue

  1. Open src/mac/_lightblue.py and change to (line 468) 更改为 (第468行)
  2. Download and unzip , which contains a LightAquaBlue directory. ,其中包含一个LightAquaBlue目录。 Move this directory into your python site-packages library, eg /Library/Python/2.6/site-packages
  3. Download and unzip , which contains a (completely different) LightAquaBlue directory. ,其中包含一个(完全不同的)LightAquaBlue目录。 Move this directory into src/mac to replace the existing src/mac/LightAquaBlue directory. This should fix the architecture/build problems that existed with the old LightAquaBlue xcode project.
  4. Run as per normal to install. 进行安装。

Now when running python setup.py install ,I got this : ** BUILD SUCCEEDED ** Using pip will fail, except we alter some of installation source folders as above. I got 'build succeeded', but haven't tested the module yet, as I need to finish other installation steps. I'm installing nxt-python ( python interface to control/program my lego mindstorm NXT -> nxt-python ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM