简体   繁体   English

如何在Snow Leopard上安装lightblue(蓝牙)模块?

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

I'm trying to install the bluetooth module from lightblue . 我正在尝试从lightblue安装蓝牙模块。

My system: Mac OS X Snow Leopard 10.6.8, Python 2.7, gcc 4.2 & 4.0, xcode v.3.2.3 . 我的系统: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/) 我检查了一下,我在系统中的/ Library / Python /下也直接找到了python 2.3 / 2.5 / 2.6文件夹(这与/Library/Frameworks/Python.framework/Versions/2.7/中的2.7不同)

When I install lightblue with python setup.py install , I get the following error: 当我使用python setup.py install安装lightblue时,出现以下错误:

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. 所以我认为这与gcc版本有关。 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). 所以我做了:'export CC = gcc-4.0'或'export CC = / usr / bin / gcc-4.0'(我的Mac上有2个版本的gcc; 4.2和4.0)。 Then I checked with gcc -v , it's already switched from 4.2 to 4.0. 然后我用gcc -v检查,它已经从4.2切换到4.0。 But when I rerun python setup.py install , it is still showing 4.2: 但是当我重新运行python setup.py install ,它仍然显示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? 为什么仍显示gcc 4.2?

Does anyone have any solution? 有人有什么解决方案吗? I tried using pip but got the same result. 我尝试使用pip,但结果相同。

I accidentally found the solution, I grabbed this from : lightblue 我不小心找到了解决方案,我从: lightblue抓起了它

For Mac OS 10.6 users: 对于Mac OS 10.6用户:

  1. Open src/mac/_lightblue.py and change signature="v@:@iB" to signature="v@:@iZ" (line 468) 打开src / mac / _lightblue.py,并将signature =“ v @:@ iB”更改为signature =“ v @:@ iZ” (第468行)
  2. Download and unzip LightAquaBlue-python-MacOS10.6.zip , which contains a LightAquaBlue directory. 下载并解压缩LightAquaBlue-python-MacOS10.6.zip ,其中包含一个LightAquaBlue目录。 Move this directory into your python site-packages library, eg /Library/Python/2.6/site-packages 将此目录移到您的python site-packages库中,例如/Library/Python/2.6/site-packages
  3. Download and unzip LightAquaBlue-framework-MacOS10.6.zip , which contains a (completely different) LightAquaBlue directory. 下载并解压缩LightAquaBlue-framework-MacOS10.6.zip ,其中包含一个(完全不同的)LightAquaBlue目录。 Move this directory into src/mac to replace the existing src/mac/LightAquaBlue directory. 将此目录移到src / mac中,以替换现有的src / mac / LightAquaBlue目录。 This should fix the architecture/build problems that existed with the old LightAquaBlue xcode project. 这应该可以解决旧的LightAquaBlue xcode项目中存在的体系结构/构建问题。
  4. Run python setup.py install as per normal to install. 按照常规运行python setup.py 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. 现在,当运行python setup.py install ,我得到了这个信息: ** BUILD SUCCEEDED **使用pip将会失败,除非我们如上所述更改一些安装源文件夹。 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 ). 我正在安装nxt-python(用于控制/编程我的乐高头脑风暴NXT- > nxt-python的python接口 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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